Difference between revisions of "Documentation/How Tos/Calc: N function"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial content)
 
m
 
(14 intermediate revisions by 7 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{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 ==
Line 8: Line 13:
 
<tt>'''N(value)'''</tt>
 
<tt>'''N(value)'''</tt>
  
:This function returns the numeric value of <tt>'''value'''</tt> if possible and <tt>'''0'''</tt> otherwise. It returns the logical values <tt>'''TRUE'''</tt> and <tt>'''FALSE'''</tt> as <tt>'''1'''</tt> and <tt>'''0'''</tt> respectively, and converts text representing a number to that number. It returns non-numeric text and errors as <tt>'''0'''</tt>.
+
: returns the numeric value of <tt>'''value'''</tt> if possible. It returns the logical values <tt>'''TRUE'''</tt> and <tt>'''FALSE'''</tt> as <tt>'''1'''</tt> and <tt>'''0'''</tt> respectively.
 +
 
 +
: <tt>'''N()'''</tt> is not intended to convert text to a number - use the <tt>'''VALUE()'''</tt> function instead.
  
  
Line 21: Line 28:
 
: where A3 contains <tt>'''FALSE'''</tt>, returns <tt>'''0'''</tt>.
 
: where A3 contains <tt>'''FALSE'''</tt>, returns <tt>'''0'''</tt>.
  
<tt>'''N("abc")'''</tt>
 
: returns <tt>'''0'''</tt>, because <tt>'''"abc"'''</tt> is text which cannot be converted to a number.
 
 
<tt>'''N("1.23")'''</tt>
 
:  returns <tt>'''1.23'''</tt> as a number.
 
  
 +
{{SeeAlso|EN|
 +
* [[Documentation/How_Tos/Calc: ISNUMBER function|ISNUMBER]]
 +
* [[Documentation/How_Tos/Calc: VALUE function|VALUE]]
 +
* [[Documentation/How_Tos/Calc: T function|T]]
 +
* [[Documentation/How_Tos/Calc: TEXT function|TEXT]]
 +
* [[Documentation/How_Tos/Calc: FIXED function|FIXED]]
 +
* [[Documentation/How_Tos/Calc: DECIMAL function|DECIMAL]]
  
=== See also: ===
+
* [[Documentation/How_Tos/Calc: Information functions|Information functions]]
'''[[Documentation/How_Tos/Calc: ISNUMBER function|ISNUMBER function]]'''
+
  
'''[[Documentation/How_Tos/Calc: Information functions|Information functions]]'''
+
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 +
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 +
[[Category: Documentation/Reference/Calc/Information functions]]

Latest revision as of 13:29, 31 January 2024

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.




See Also
Retrieved from "https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_N_function&oldid=259820"
Views
Personal tools
Navigation
Tools
In other languages