Identify a Value’s Type with TYPE

Excel Formulas › Information

All versionsTYPE

TYPE returns a code telling you what kind of value a cell holds — number, text, logical, error, or array. Handy for branching logic that must react differently to numbers versus text.


Quick formula: what type of value is in A2?
=TYPE(A2)
1 = number, 2 = text, 4 = logical (TRUE/FALSE), 16 = error, 64 = array.

Functions used (tap for the full reference guide):

The example

Each value maps to a type code.

AB
1ValueTYPE
21001
3Hello2

The formula

The formula:

=TYPE(A2) // number=1, text=2, …

How it works

How it works:

  1. TYPE(value) returns a numeric code for the value’s kind.
  2. The codes: 1 number, 2 text, 4 logical, 16 error, 64 array.
  3. Use it to branch: =IF(TYPE(A2)=1, A2*1.1, "Enter a number").
  4. For simple yes/no checks, ISNUMBER, ISTEXT, and ISLOGICAL are often clearer.

TYPE looks at the result, not the formula. =TYPE(A2) where A2 holds =1+1 returns 1 (number), because it sees the computed value. To know whether A2 is a formula, use ISFORMULA instead.

Try it: interactive demo

Live demo

Pick a value.

TYPE code:

Variations

Is it a number?

Cleaner check:

=ISNUMBER(A2)

Branch on type

React differently:

=IF(TYPE(A2)=1, "num", "other")

Is it an error?

Type 16:

=ISERROR(A2)

Pitfalls & errors

It reads the value. TYPE reports the computed result’s kind, not whether the cell is a formula.

Logical is 4, not 1. TRUE/FALSE are their own type even though they act like 1/0 in math.

Prefer IS-functions. For a single check, ISNUMBER/ISTEXT read more clearly than a TYPE code.

Practice workbook

📊
Download the free Identify a Value's Type with TYPE practice workbook
A TYPE sheet with the ISNUMBER, branch, and ISERROR variants, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

What does the TYPE function return in Excel?
A code for the value's kind: 1 number, 2 text, 4 logical, 16 error, 64 array. For example =TYPE("Hello") returns 2.
Does TYPE tell me if a cell is a formula?
No — it reports the kind of the computed value. Use ISFORMULA to detect a formula cell.
Should I use TYPE or ISNUMBER?
For a single yes/no check, ISNUMBER, ISTEXT, or ISLOGICAL are clearer. TYPE is best when you need to branch among several kinds.

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: ISNUMBER & ISTEXT · Route by data type · Detect formula cells

Function references: TYPE