TYPE Function
Returns a number code for a value's type.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| value | The value, cell reference, or formula result whose type is tested. | Required |
Basic Example
Test a text string
=TYPE("x")"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)Example 2: Classify a logical value
Test TRUE/FALSE.Logical values return 4
=TYPE(TRUE)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.
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
TYPE
typePractice 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.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps