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.
The example
Each value maps to a type code.
| A | B | |
|---|---|---|
| 1 | Value | TYPE |
| 2 | 100 | 1 |
| 3 | Hello | 2 |
The formula
The formula:
How it works
How it works:
TYPE(value)returns a numeric code for the value’s kind.- The codes: 1 number, 2 text, 4 logical, 16 error, 64 array.
- Use it to branch:
=IF(TYPE(A2)=1, A2*1.1, "Enter a number"). - For simple yes/no checks,
ISNUMBER,ISTEXT, andISLOGICALare 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
Pick a value.
Variations
Is it a number?
Cleaner check:
Branch on type
React differently:
Is it an error?
Type 16:
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
Frequently asked questions
What does the TYPE function return in Excel?
Does TYPE tell me if a cell is a formula?
Should I use TYPE or ISNUMBER?
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