Category: FUNCTION | Updated: 2026-11-22

How to Use the TYPE Function | Identify a Value's Data Type with a Numeric Code

Syntax

=TYPE(value)
  • value: Specifies the cell reference, direct value, or formula whose data type you want to inspect.

Practical Table Example

This example enters values of various data types in column A and uses the TYPE function in column B to determine the data type code.

Cell Input Value Formula Result Detected Data Type
A2 100 =TYPE(A2) 1 Number (including dates and times)
A3 Hello =TYPE(A3) 2 Text (string)
A4 TRUE =TYPE(A4) 4 Logical value (TRUE / FALSE)
A5 =1/0 =TYPE(A5) 16 Error value (#DIV/0!, etc.)
A6 ={1, 2, 3} =TYPE(A6) 64 Array

Common Errors and Precautions

  • Cannot check for the presence of a formula itself: Because =TYPE(A2) returns the type of the calculated result, use the ISFORMULA function if you want to check whether a cell contains a formula.
  • Handling of blank cells: When referencing an empty blank cell, it is treated the same as the number 0 and returns 1.
  • Error from missing argument: Omitting the argument and entering =TYPE() results in a #N/A error.

Frequently Asked Questions

Q. What values does the TYPE function return?

A. It returns 1 for a number, 2 for text, 4 for a logical value, 16 for an error value, 64 for an array, and 128 for any other type of data.

Q. If a cell contains a formula, what does the TYPE function evaluate?

A. It evaluates the 'data type of the result' calculated and returned by the formula, not the formula itself.