TYPE
TheTYPE
formula in Google Sheets is used to determine the data type of the specified value. The result will be a number that corresponds to the data type, with 1 being a number, 2 being text, 3 being a logical value (TRUE or FALSE), 4 being an error value, 5 being a range, 6 being an array, and 7 being a cell reference. This formula is commonly used in conjunction with other formulas that require a certain data type as input.
- How to use
TYPE
formula? - Examples of using
TYPE
formula TYPE
formula not working?- Similar formulas to
TYPE
Usage
Use the TYPE
formula with the syntax shown below, it has 1 required parameter:
- value (required):
The value whose data type you want to determine. This can be a number, text, logical value, error value, range, array, or cell reference.
Examples
Here are a few example use cases that explain how to use theTYPE
formula in Google Sheets.
Checking data type of input
One of the most common use cases for the TYPE
formula is to check the data type of an input value in order to ensure it is compatible with other formulas being used. For example, if you are trying to perform a calculation that requires a number input, you can use TYPE
to verify that the input is indeed a number before proceeding.
Handling error values
The TYPE
formula can also be used to handle error values in a spreadsheet. If a formula returns an error value, you can use TYPE
to identify the type of error and take appropriate action, such as displaying a custom error message or performing a different calculation.
Identifying cell references
When working with complex formulas, it can be helpful to know whether a particular value is a cell reference or not. The TYPE
formula can be used to identify cell references, which can then be used in other formulas to dynamically reference cells based on certain criteria.
Common Mistakes
TYPE
not working? Here are some common mistakes people make when using the TYPE
Google Sheets Formula:
Incorrect argument type
The TYPE function only accepts one argument of any data type. Make sure the input is correct and matches the expected data type.
Using a range as input
The TYPE function only works with individual cells or values. If you want to get the type for a range, you need to use an array formula or another function to reference the individual value within the range.
Missing argument
The TYPE function requires an argument. Make sure that you have provided a value to the function.
Using the wrong function
If you are trying to check the type of a range, you may be better off using the ARRAYFORMULA function or another function that can handle ranges.
Using a non-existent function
Make sure that you are using the correct spelling and syntax for the TYPE function. Check that you have not misspelled the function name or used incorrect syntax.
Related Formulas
The following functions are similar to TYPE
or are often used with it in a formula:
-
ISNUMBER
The
ISNUMBER
formula is used to check if a given value is a number. It returns TRUE if the value is a number and FALSE if it is not. This formula is commonly used in data cleaning and validation to identify and remove non-numeric values or to ensure that a cell only contains a number. -
ISTEXT
The
ISTEXT
function checks whether the value provided is a text string or not. It returns TRUE if the value is text and FALSE if it is any other data type. This function is commonly used when working with data sets that contain text and non-text values. -
ISLOGICAL
The
ISLOGICAL
formula is used to check if a value is a logical value (TRUE or FALSE). If the value is a logical value, the formula returns TRUE. If the value is not a logical value, the formula returns FALSE. -
ISERROR
The
ISERROR
formula is used to check if a value contains an error. This formula returnsTRUE
if the value is an error, andFALSE
if it is not. This function is most commonly used in combination with other formulas that can return errors, to ensure that the resulting value is valid. -
INDIRECT
The
INDIRECT
formula is used to return a cell reference specified by a string. This can be useful when you need to dynamically reference a cell based on the value in another cell. TheINDIRECT
formula can also be used to reference cells in other sheets or workbooks.
Learn More
You can learn more about the TYPE
Google Sheets function on Google Support.