Difference between revisions of "Documentation/How Tos/Calc: N function"
From Apache OpenOffice Wiki
< Documentation | How Tos
m |
|||
Line 1: | Line 1: | ||
− | {{ | + | {{DISPLAYTITLE:N function}} |
− | + | {{Documentation/CalcFunc InformationTOC | |
− | + | |ShowPrevNext=block | |
− | + | |PrevPage=Documentation/How_Tos/Calc:_ISTEXT_function | |
− | | | + | |NextPage=Documentation/How_Tos/Calc:_NA_function |
− | + | }}__NOTOC__ | |
− | | | + | |
− | + | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== N == | == N == | ||
Returns the numeric value. | Returns the numeric value. | ||
Line 52: | Line 29: | ||
===Issues: === | ===Issues: === | ||
− | <tt>'''N()'''</tt> in Calc will sometimes convert text to a number, but in Excel will always return text as <tt>'''0'''</tt>. In Calc <tt>'''N("4")'''</tt> returns <tt>'''0'''</tt> in OOo3 but <tt>'''4'''</tt> in OOo2. {{Issue|113739}} describes some further inconsistencies in the handling of text. In fact, the ODFF standard deliberately does not specify a | + | <tt>'''N()'''</tt> in Calc will sometimes convert text to a number, but in Excel will always return text as <tt>'''0'''</tt>. In Calc <tt>'''N("4")'''</tt> returns <tt>'''0'''</tt> in OOo3 but <tt>'''4'''</tt> in OOo2. {{Issue|113739}} describes some further inconsistencies in the handling of text. In fact, the ODFF standard deliberately does not specify a behavior. It may be better to use <tt>'''VALUE()'''</tt> to convert from text to number. |
{{SeeAlso|EN| | {{SeeAlso|EN| |
Revision as of 13:28, 31 January 2024
- Information Functions
- CELLCURRENTFORMULAISBLANKISERRISERRORISEVENISEVEN ADDISLOGICALISNAISNONTEXTISNUMBERISODDISODD ADDISREFISTEXT
N
Returns the numeric value.
Syntax:
N(value)
- returns the numeric value of value if possible. It returns the logical values TRUE and FALSE as 1 and 0 respectively.
- N() is not intended to convert text to a number - use the VALUE() function instead.
Example:
N(123)
- returns 123, because 123 is (already) a number.
N(TRUE)
- returns 1.
N(A3)
- where A3 contains FALSE, returns 0.
Issues:
N() in Calc will sometimes convert text to a number, but in Excel will always return text as 0. In Calc N("4") returns 0 in OOo3 but 4 in OOo2. Issue 113739 describes some further inconsistencies in the handling of text. In fact, the ODFF standard deliberately does not specify a behavior. It may be better to use VALUE() to convert from text to number.
See Also
-