Information function

TYPE function

Returns a code for the kind of value: 1 number, 2 text, 4 logical, 16 error, 64 array (and 128 for compound data in Microsoft 365).

Available in All versions of Excel, including Microsoft 365 and Excel for the web (the code 128 applies to Microsoft 365 data types)

In every Excel versionWorks in Google Sheets

Syntax

TYPE(value)
ArgumentWhat it means
valueRequiredAny value, cell reference or formula result.

Returns: 1 for numbers (including dates and empty cells), 2 for text, 4 for logical values, 16 for errors, 64 for arrays, 128 for compound data such as linked data types.

How TYPE works

TYPE tells you what kind of value something is, as a number code. It is the single-function alternative to a series of IS functions: rather than testing ISNUMBER, ISTEXT, ISLOGICAL and ISERROR one after another, one TYPE call returns 1, 2, 4 or 16, which you can feed into SWITCH or CHOOSE.

A few behaviours to know: an empty cell returns 1, because it is treated as the number 0; a date returns 1 because dates are numbers; and TYPE looks at the result of a formula, not at the formula itself (use ISFORMULA for that). An array constant such as {1,2,3} returns 64. TYPE is also handy in LAMBDA functions that need to behave differently depending on the input they receive.

Examples

1A number

C2fx=TYPE(B2)
ABC
1FieldValue
2Amount12501
3StatusPending
4ApprovedTRUE
5Margin#DIV/0!

Result: 1

1,250 is a number, so TYPE returns 1. B3 (Pending) returns 2, B4 (TRUE) returns 4 and B5 (#DIV/0!) returns 16.

2Readable labels with SWITCH

C5fx=SWITCH(TYPE(B5), 1, "Number", 2, "Text", 4, "True/False", 16, "Error", "Other")
ABC
1FieldValue
2Amount1250
3StatusPending
4ApprovedTRUE
5Margin#DIV/0!Error

Result: Error

B5 holds an error, TYPE returns 16, and SWITCH turns the code into the word Error.

3An array constant

A1fx=TYPE({10,20,30})
A
164

Result: 64

The braces create an array of three values, which TYPE reports with code 64.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 16 KB

Tips

  • Empty cells return 1, not a special code. Test with ISBLANK first if you need to tell blanks apart.
  • Numbers stored as text return 2, so TYPE is a fast way to audit an imported column: anything showing 2 in an amount column needs converting.

Google Sheets

TYPE also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

TYPE in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechTYP
DanishVÆRDITYPE
FinnishTYYPPI
GermanTYP
HungarianTÍPUS
ItalianTIPO
Norwegian (Bokmål)VERDITYPE
PolishTYP
Portuguese (Brazil)TIPO
Portuguese (Portugal)TIPO
RussianТИП
SpanishTIPO
SwedishVÄRDETYP
TurkishTÜR