Value
The value whose type should be returned.
Returns
1 If the value is a number, 2 if the value is a text string, 4 if the value is a logical value, 16 if the value is an error, 64 if the value is an array, 32768 (2^15) if the value is a temporal value and 65536 (2^16) if the value is a color.
Returns the type of the given value. TYPE (42) TYPE (42) returns 1, indicating that 42 is a number.
These are the values returned by this function:
| Type of value | Return value |
|---|---|
| Number | 1 |
| Text | 2 |
| Logical (TRUE or FALSE) | 4 |
| Error | 16 |
Array ( { ? } ) |
64 |
| Temporal (a date, a time of day or both) | 32768 (2^15) |
| Color | 65536 (2^16) |
The codes 1, 2, 4, 16 and 64 are the ones used by spreadsheet programs. The codes 32768 and 65536 are fxEngine extensions, as spreadsheets have neither a temporal type nor a color type distinct from the number type. Extension codes are assigned in descending order starting at 65536 (2^16), so that they move away from the codes used by spreadsheet programs, which ascend from 1.
Examples
Returns 1, indicating that 42 is a number.
Returns 2, indicating that "42" is a text string.
Returns 4, indicating that TRUE is a logical value.
Returns 16, provided that Value2 is 0 or blank, which triggers a #DIV/0! error ("division by zero"). Otherwise, 1 is returned, indicating that the value is a number.
Returns 64, indicating that the value is an array.
Returns 65536, indicating that the value is a color.