Excel function

TYPEfunction

Returns a number that tells you the type of a value.

All versions
=TYPE(A2)
A
B
C
1
2
3
4
5
6
7
8
9
10

Click a cell in the table to change value. Click the cells: number 1, text 2, logical 4, error 16. Try breaking it on purpose to see the errors.

Result

2

value
A2You can also click a cell in the table

The cell to test. Click another value in column A.

What is the TYPE function?

=TYPE(value)

TYPE returns a number for the kind of value: 1 for a number, 2 for text, 4 for a logical value, 16 for an error value and 64 for an array.

Column A of the sheet mixes text, numbers, a blank, a logical value, errors and text that looks like a number; column B says what each is. Column C shows the same formula copied down.

TYPE tells apart values that look the same, most usefully numbers and numbers stored as text. When a SUM from pasted data comes out wrong, look for cells where TYPE returns 2 (text).

Arguments

value
The value or cell to test.

TYPE examples

  1. Example 1. A number

    =TYPE(A3)

    1.

  2. Example 2. Text

    =TYPE(A2)

    2.

  3. Example 3. An error

    =TYPE(A6)

    16.

  4. Example 4. Kinds of value and their codes

    =TYPE(A2)

    For a cell with a formula, TYPE reports the kind of the result.

    Value=TYPE(value)
    1201 (number)
    "120"2 (text)
    TRUE4 (logical)
    #N/A16 (error)
    {1,2,3}64 (array)
  5. Example 5. Find numbers stored as text

    =IF(AND(TYPE(A2)=2, ISNUMBER(VALUE(A2))), "Text number", "")

    Marks text cells that VALUE can turn into a number.

Common mistakes

FAQ

How is it different from the IS functions?
IS functions say TRUE/FALSE for one kind; TYPE tells you the kind as a number.
Where is it used?
To split a calculation by input type, together with CHOOSE or SWITCH.
How do I show the kind as a word?
=SWITCH(TYPE(A2), 1, "Number", 2, "Text", 4, "Logical", 16, "Error", "Other").