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

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial content)
 
m
Line 8: Line 8:
 
<tt>'''TYPE(value)'''</tt>
 
<tt>'''TYPE(value)'''</tt>
  
: Returns the type of value as a number:  <tt>'''1'''</tt> = number, <tt>'''2'''</tt> = text, <tt>'''4'''</tt> = logical value, <tt>'''8'''</tt> = formula, <tt>'''16'''</tt> = error value. When a cell contains both an error and a formula, <tt>'''16'''</tt> (error value) is returned.
+
: Returns the type of value as a number:  <tt>'''1'''</tt> = number, <tt>'''2'''</tt> = text, <tt>'''4'''</tt> = logical value, <tt>'''8'''</tt> = formula, <tt>'''16'''</tt> = error value.
 +
 +
: If a cell contains both an error and a formula, <tt>'''16'''</tt> (error value) is returned.
 +
: A blank cell is classed as a number here, and <tt>'''1'''</tt> is returned.
  
  

Revision as of 20:23, 7 December 2007


TYPE

Returns the type of value (number, text, etc.).


Syntax:

TYPE(value)

Returns the type of value as a number: 1 = number, 2 = text, 4 = logical value, 8 = formula, 16 = error value.
If a cell contains both an error and a formula, 16 (error value) is returned.
A blank cell is classed as a number here, and 1 is returned.


Example:

TYPE(C2)

where cell C2 contains dog returns 2, because dog is text.

TYPE(C3)

where cell C3 contains =NA() returns 16, because NA() returns the error value #N/A.


See also:

CELL function

Information functions

Personal tools