The Excel TYPE Function

Function 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:

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


Excel Type Function Examples

The following spreadsheet shows examples of the Excel Type function.

 Formulas:
  A B
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:
  A B
1 1  
2 2  
3 4  
4 64  
5 1  
6 16 #VALUE!
7 1  

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.


For further details and examples of the Excel Type function, see the Microsoft Office website.