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.

TYPE is useful when a workbook needs a low-level view of what kind of value it is handling. Instead of checking one condition at a time, TYPE gives a coded answer that can help diagnose whether a result is text, a number, a logical value, an error, or an array-style result.

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

This example shows the code Excel uses for a standard numeric value. When TYPE returns 1, it means the input is being treated as a number.

That gives you a quick way to inspect how Excel sees the value behind the display. It is especially useful when you are checking imported data or mixed-value formulas.

=TYPE(A1)
Check Answer
Challenge #1
Target: Sheet1!D2

In cell D2, check the type code of a number.

Example 2 - Check a blank cell reference

This is one of the stranger results in the function. If you point TYPE at a blank cell reference, Excel still returns 1 instead of a special blank code.

That matters because it can surprise people who expect blanks to behave differently. This example helps you remember that TYPE is not a dedicated blank-checking tool.

=TYPE(B2)
Check Answer
Challenge #2
Target: Sheet1!D3

In cell D3, check the type code of a blank cell reference.

Example 3 - Check an error value

This example shows how TYPE identifies an error. When the value is an Excel error such as #DIV/0! or #N/A, the function returns 16.

That can be useful in debugging, especially when a formula result is being passed around and you want to confirm that the value is an error type rather than text or a number.

=TYPE(D1)
Check Answer
Challenge #3
Target: Sheet1!D4

In cell D4, check the type code of an error value.

Example 4 - Check an array constant

This example is useful because arrays behave differently from single values. When the input is an array constant, TYPE returns 64.

That helps you recognize when a formula is dealing with a grouped set of values instead of just one item, which matters more in newer Excel formulas and dynamic-array work.

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

In cell D5, check the type code of an array constant.

Conclusion Recap

TYPE is useful when one formula can receive different kinds of values and you need more than a simple TRUE or FALSE answer. This lesson covered the main codes and showed how they help with mixed inputs like numbers, text, errors, logical values, and arrays.

The one detail worth remembering is the blank-cell behavior, because it surprises a lot of beginners. A blank reference returns 1 here, so TYPE is helpful for broad classification, but you still need to read the code carefully.

  • 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
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.