TYPE
Returns an Excel TYPE code describing the value category.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=TYPE(value)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
value | any | Required | — |
Remarks
- Codes:
1number,2text,4logical,16error,64array. - Spreadsheet errors return
16; operation failures still propagate. - Blank values map to numeric code
1in this implementation.
Examples
Read the type code of a numeric value.
Formula =TYPE(7)
Expected result 1
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Read the different type code for text with the same displayed character.
Formula =TYPE("7")
Expected result 2
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Read the type code for a logical value.
Formula =TYPE(TRUE)
Expected result 4
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Text type code
Formula =TYPE("abc")
Expected result 2
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
How are errors handled by TYPE?
Spreadsheet errors return Excel's error type code 16.