The Excel TYPE Function

Basic Description

For a supplied value, the Excel TYPE function returns an integer that represents the value's data type.

The syntax of the function is:

TYPE( value )

Where the supplied value is the value (or a reference to a cell containing the value) that you want to know the type of.

The integers returned by the Excel Type function and their corresponding data types are shown in the table below:

1Number
2Text
4Logical Value
16Error Value
64Array


Excel Type Function Examples

The following spreadsheet shows examples of the Excel Type function.

 Formulas:
 AB
1=TYPE( 2 ) 
2=TYPE( "text" ) 
3=TYPE( TRUE ) 
4=TYPE( {1, 2, 3} ) 
5=TYPE( 10/2 ) 
6=TYPE( B6 )#VALUE!
7=TYPE( B7 ) 
 Results:
 AB
11 
22 
34 
464 
51 
616#VALUE!
71 

Note that in cell A7 of the spreadsheet, the Type function has evaluated the empty cell B7 as the value 0. The function has therefore returned the integer 1, to denote a numeric value.


Further details and examples of the Excel Type function are provided on the Microsoft Office website.