Quick Answer

TYPE Function

Returns a number code for a value's type.

✓ Excel✓ Google SheetsExcel All versions

Syntax

TYPE
(value)

Parameters

ParameterDescriptionRequired
valueThe value, cell reference, or formula result whose type is tested.Required

Basic Example

Test a text string

=TYPE("x")
Result2

"x" is text, so the type code is 2.

Advanced Examples

Example 1: Detect an array

A multi-cell range reference is an array.

Reference a range to get code 64

=TYPE(A1:A3)
Result: 64
A range covering multiple cells is treated as an array, returning 64.

Example 2: Classify a logical value

Test TRUE/FALSE.

Logical values return 4

=TYPE(TRUE)
Result: 4
TRUE is a logical value, so the type code is 4.

How TYPE Works

TYPE examines the supplied value and returns an integer: 1 (number), 2 (text), 4 (logical TRUE/FALSE), 16 (error value), or 64 (array). It is useful inside branching logic when a formula must handle different input types differently.

1
Pick the value
Select the cell or value to classify.
2
Enter the formula
Type =TYPE(value).
3
Interpret the code
Compare the result to 1, 2, 4, 16, or 64.

Important Notes & Limitations

  • Returns 64 for any array, even a single-cell array.

  • Cannot distinguish sub-types; dates and numbers both return 1.

  • Returns a code, not TRUE/FALSE, so compare it (e.g. =TYPE(x)=2).

Common Errors & Fixes

Getting 64 unexpectedlyA multi-cell range reference is an array.

Fix: Reference a single cell if you want codes 1, 2, or 4.

Confusing TYPE with IS checksTYPE returns a code, not TRUE/FALSE.

Fix: Combine with a comparison, e.g. =TYPE(x)=2 for text.

Download Practice File

Practice TYPE with Real Data

Download a sample CSV file with pre-populated data and practice exercises for the TYPE function. Works in both Excel and Google Sheets.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Frequently Asked Questions

What does 64 mean?
It means the value is an array.
Does TYPE catch errors?
Yes, an error value returns 16.
Can TYPE test a range?
Yes; a multi-cell range returns 64.