Exceljet

Quick, clean, and to the point

Excel TYPE Function

Excel TYPE function
Summary 

The Excel TYPE function returns a numeric code representing "type" in 5 categories: number = 1, text = 2, logical = 4, error = 16, and array = 64. Use TYPE when the operation of a formula depends on the type of value in a particular cell.

Purpose 
Get the type of value in a cell
Return value 
A numeric code representing type
Syntax 
=TYPE (value)
Arguments 
  • value - The value to check the type of.
Version 
Usage notes 

The TYPE function returns a numeric code representing "type" in 5 categories: number = 1, text = 2, logical = 4, error = 16, and array = 64. The TYPE function takes one argument, value, which can be a reference, a formula, or a hardcoded value. The table below shows the possible type codes returned from TYPE and the meaning of each:

Type code Meaning
1 Number
2 Text
4 Logical value
16 Error value
64 Array

Examples

The TYPE function returns a numeric code:

=TYPE(100) // returns 1
=TYPE("apple") // returns 2
=TYPE(TRUE) // returns 4

If TYPE is given an array constant, or a range, the result is 64:

=TYPE({1;2;3}) // returns 64
=TYPE(A1:C1 // returns 64

TYPE returns 16 for errors:

=TYPE(3/0) // returns 16
=TYPE(NA()) // returns 16

Notes

  • You can't use TYPE to test for a formula, because TYPE evaluates the result.
  • Excel dates and times are numbers, and therefore return 1.

Download 100+ Important Excel Functions

Get over 100 Excel Functions you should know in one handy PDF.