FormulaCraft

TYPE

TYPE returns a numeric code that identifies what kind of value a cell or expression contains, using the codes 1 (number), 2 (text), 4 (logical/Boolean), 8 (formula), 16 (error), and 64 (array). Use it when you need to branch logic based on the category of data rather than just its content.

Excel
=TYPE(A2)
Google Sheets
=TYPE(A2)

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

How it works

  1. 1Pass a cell reference or value to TYPE (e.g., =TYPE(A2)).
  2. 2Interpret the result: 1 means number, 2 means text, 4 means TRUE/FALSE, 16 means an error value.
  3. 3Combine with IF or CHOOSE to route processing differently depending on data type: =IF(TYPE(A2)=2,UPPER(A2),A2).

Need a version for your data?

Try: “Detect whether each cell contains a number, text, or error and label it

Related

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: