TYPE in Excel: Identify Numbers, Text, Errors and Arrays
Read Excel TYPE codes with controlled values, distinguish formulas from results and build a type report without confusing text errors with real errors.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: TYPE returns a numeric code for the kind of value supplied. =TYPE(12) returns 1, while =TYPE("12") returns 2. It classifies the value, not whether a formula produced it.
Availability and version history
- Introduced: first introduction version is not established by the official history reviewed; the current product list is not a launch record.
- Availability: official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
- Checked: October 14, 2026; official TYPE reference. Documentation and independently modeled examples; no native Excel execution or broader platform certification.
Syntax and the documented code table
=TYPE(value)
The required value may be a literal, expression or reference.
| Value category | Code |
|---|---|
| Number | 1 |
| Text | 2 |
| Logical value | 4 |
| Error value | 16 |
| Array | 64 |
| Compound data | 128 |
The current reference lists compound data but does not establish feature availability for every listed product. This guide supplies no linked-data setup or cross-version compound-data execution claim. Do not treat the codes as a consecutive sequence or assume that missing numbers identify additional supported categories.
Example 1: audit scalar results
Enter these controls in A2:A8, then fill =TYPE(A2) down column B.
| Cell | Entry | Expected TYPE code |
|---|---|---|
| A2 | number 12 |
1 |
| A3 | ="12" |
2 |
| A4 | =TRUE() |
4 |
| A5 | =NA() |
16 |
| A6 | ="" |
2 |
| A7 | =5+7 |
1 |
| A8 | ="#N/A" |
2 |
A2 and A7 return the same type code despite one being a constant and the other a formula. A5 is an actual error; A8 is text containing the error’s spelling. A6 is empty text, not an unclassified value.
These seven rows contain two numeric results, three text results, one Boolean and one error. A TYPE helper can reveal a data-import problem even when numeric text looks identical to a number on screen.
Example 2: turn codes into a readable audit label
With the code already in B2, use this formula in C2 and fill down:
=IF(B2=1,"Number",IF(B2=2,"Text",IF(B2=4,"Logical",IF(B2=16,"Error","Other documented type"))))
The labels are Number, Text, Logical, Error, Text, Number, Text. The catch-all wording avoids falsely calling arrays or compound data invalid simply because this small report focuses on four scalar categories.
Keep a separate content rule when needed. A numeric type can still hold a negative quantity or an out-of-range score. A text type can contain an empty string or an invalid identifier. TYPE diagnoses the representation rather than the business meaning.
Example 3: distinguish an array from its elements
In an English-separator worksheet, use this literal array control:
=TYPE({2,4;6,8})
Expected result: 64. Commas separate columns and the semicolon separates rows in this displayed array constant. The array has two rows and two columns, but TYPE returns one category code, not its dimensions or four individual type codes.
Compare =TYPE(2), which returns 1. All four elements in the literal matrix are numbers, yet the argument passed to TYPE is the array as a whole. Do not automatically transfer that control to every multi-cell reference or implicit-intersection context; those entry and evaluation details require separate checking.
Example 4: inspect a formula without confusing its result type
Put =6*7 in E2 and numeric 42 in E3. =TYPE(E2) and =TYPE(E3) both return 1. To inspect the formula itself, =FORMULATEXT(E2) returns the text =6*7, while FORMULATEXT on the constant cell returns its documented missing-formula error.
Thus a formula audit and a result-type audit need different tools. Likewise, =TYPE(1/0) returns 16, but it does not identify which error occurred. ERROR.TYPE provides documented error-class codes.
Troubleshooting and related functions
Use ISNUMBER or ISTEXT for a single yes/no type question. Use FORMULATEXT when inspecting formula content. This guide does not infer the full blank-reference, array-spill or rich-type behavior matrix from the simple scalar and literal-array controls.
References and verification
The datasets are fictional. Expected results follow the cited rules and independent arithmetic or type models; they are not native application captures. Examples use English function names and comma argument separators.