
Return a numeric code that tells you the data type of a value.
TYPE returns a numeric code that tells you the data type of a value. Instead of giving you TRUE or FALSE for one specific test, it gives you a broader classification in one result.
Microsoft documents these core codes: 1 for number, 2 for text, 4 for logical value, 16 for error, 64 for array, and 128 for compound data. That makes TYPE useful when a formula can receive different kinds of input and you need to react differently to each one.
TYPE is useful when a workbook needs a low-level view of what kind of value it is handling. Instead of checking one condition at a time, TYPE gives a coded answer that can help diagnose whether a result is text, a number, a logical value, an error, or an array-style result.
Classifies a value with a numeric code instead of a simple yes or no result.
The result is a code such as 1, 2, 4, 16, 64, or 128.
=TYPE(value)
You can use a direct value, a formula result, or a cell reference.
| Function | Main job | Use it when |
|---|---|---|
TYPE |
Returns a detailed type code | You need broader classification in one formula. |
ISNUMBER |
Checks for numbers only | You only care whether something is numeric. |
ISTEXT |
Checks for text only | You only care whether something is text. |
ISLOGICAL |
Checks for logical values only | You only care whether something is TRUE or FALSE. |
This function is helpful when one formula can receive mixed input. Instead of stacking several IS... functions, you can call TYPE once and switch behavior based on the returned code.
One nuance matters here. A blank cell reference returns 1, which is the same code used for numbers. That can surprise people if they expect blanks to get their own separate code.
This example shows the code Excel uses for a standard numeric value. When TYPE returns 1, it means the input is being treated as a number.
That gives you a quick way to inspect how Excel sees the value behind the display. It is especially useful when you are checking imported data or mixed-value formulas.
=TYPE(A1)
In cell D2, check the type code of a number.
This is one of the stranger results in the function. If you point TYPE at a blank cell reference, Excel still returns 1 instead of a special blank code.
That matters because it can surprise people who expect blanks to behave differently. This example helps you remember that TYPE is not a dedicated blank-checking tool.
=TYPE(B2)
In cell D3, check the type code of a blank cell reference.
This example shows how TYPE identifies an error. When the value is an Excel error such as #DIV/0! or #N/A, the function returns 16.
That can be useful in debugging, especially when a formula result is being passed around and you want to confirm that the value is an error type rather than text or a number.
=TYPE(D1)
In cell D4, check the type code of an error value.
This example is useful because arrays behave differently from single values. When the input is an array constant, TYPE returns 64.
That helps you recognize when a formula is dealing with a grouped set of values instead of just one item, which matters more in newer Excel formulas and dynamic-array work.
=TYPE({1,2,3})
In cell D5, check the type code of an array constant.
TYPE is useful when one formula can receive different kinds of values and you need more than a simple TRUE or FALSE answer. This lesson covered the main codes and showed how they help with mixed inputs like numbers, text, errors, logical values, and arrays.
The one detail worth remembering is the blank-cell behavior, because it surprises a lot of beginners. A blank reference returns 1 here, so TYPE is helpful for broad classification, but you still need to read the code carefully.
TYPE classifies a value with a numeric code.Tell your friends about this post