For a supplied value, the Excel TYPE function returns an integer that represents the value’s data type.
Syntax:= TYPE (value)
The TYPE function syntax has the following arguments:
- Value Required. Can be any Microsoft Excel value, such as a number, text, logical value, and so on.
If value is | TYPE returns |
---|---|
Number | 1 |
Text | 2 |
Logical value | 4 |
Error value | 16 |
Array | 64 |
Example: Let’s look at some Excel TYPE function examples and explore how to use the TYPE function as a worksheet function in Microsoft Excel:
Syntax: =TYPE(A2)
Result:
Based on the Excel spreadsheet above, the following TYPE examples would return:
Syntax: =TYPE(A3)
Result: 1
Syntax: =TYPE(A4)
Result: 1
Syntax: =TYPE(A5)
Result: 1
Syntax: =TYPE(“USA”&A6)
Result: 2
Syntax: =TYPE(A7)
Result: 16
Syntax: =TYPE(A8)
Result: 4
Syntax: =TYPE(A9)
Result: 2
Syntax: =TYPE(A10+A2)
Result: 1
Syntax: =TYPE({1,3;5,7})
Result: 64
Note:
- You can’t use TYPE to test for a formula, because TYPE evaluates the result of formulas and functions.
- You can use TYPE to find out the type of data that is returned by a function or formula.