TYPE Function

TYPE Function

TYPE Function

Return a numeric code that tells you the data type of a value.

ExcelClash Team
PUBLISHED

Summary

TYPE returns a numeric code that tells you the data type of a value. Instead of giving you TRUE or FALSE for one specific test, it gives you a broader classification in one result.

Microsoft documents these core codes: 1 for number, 2 for text, 4 for logical value, 16 for error, 64 for array, and 128 for compound data. That makes TYPE useful when a formula can receive different kinds of input and you need to react differently to each one.

Purpose

Return a type code

Classifies a value with a numeric code instead of a simple yes or no result.

Return Value

Numeric code

The result is a code such as 1, 2, 4, 16, 64, or 128.

Syntax

=TYPE(value)

You can use a direct value, a formula result, or a cell reference.

Arguments

  • value - [required] The value you want to classify.

TYPE vs Individual IS Functions

Function Main job Use it when
TYPE Returns a detailed type code You need broader classification in one formula.
ISNUMBER Checks for numbers only You only care whether something is numeric.
ISTEXT Checks for text only You only care whether something is text.
ISLOGICAL Checks for logical values only You only care whether something is TRUE or FALSE.

Using TYPE

This function is helpful when one formula can receive mixed input. Instead of stacking several IS... functions, you can call TYPE once and switch behavior based on the returned code.

One nuance matters here. A blank cell reference returns 1, which is the same code used for numbers. That can surprise people if they expect blanks to get their own separate code.

Example 1 - Return the code for a number

A normal number returns code 1.

=TYPE(A1)
Check Answer
Challenge #1
Target: Sheet1!F1
Number Type

Check the type code of 100 in A1. Formula: =TYPE(A1).

Example 2 - Check a blank cell reference

A blank cell reference still returns 1 here.

=TYPE(B2)
Check Answer
Challenge #2
Target: Sheet1!F2
Blank Cell Type

Check the type code of a blank cell in B2. Formula: =TYPE(B2).

Example 3 - Check an error value

Error values return code 16.

=TYPE(D1)
Check Answer
Challenge #3
Target: Sheet1!F3
Error Type

Check the type code of #N/A in D1. Formula: =TYPE(D1).

Example 4 - Check an array constant

Arrays return code 64.

=TYPE({1,2,3})
Check Answer
Challenge #4
Target: Sheet1!F4
Array Type

Check the type code of an array constant. Formula: =TYPE({1,2,3}).

Conclusion Recap

  • Main job: TYPE classifies a value with a numeric code.
  • Core codes: 1 number, 2 text, 4 logical, 16 error, 64 array, 128 compound.
  • Important nuance: A blank cell reference returns 1 here.
  • Best use: When one formula needs to react to multiple possible input types.
Tactical Arena
Select Scenario:
Share TYPE Function!

Tell your friends about this post

Discussion

ExcelClash is an interactive platform designed to level up your Excel skills through real-world exercises and challenges. Sharpen your logic, solve real spreadsheet problems, and learn faster.

© 2026 ExcelClash, Inc. All rights reserved.