The Google Sheets function TYPE is a valuable tool that returns a numerical code indicating the type of data contained in a specified cell or expression. This function is particularly useful for evaluating and categorizing the data present in your spreadsheet, allowing users to better manage their datasets and formulas.
Syntax
TYPE(value)
- value: The cell reference or value whose type you want to determine.
Example #1
TYPE("Hello, World!")
This function checks the type of the string “Hello, World!” and returns 2, indicating that the input is a string. Result: 2
Example #2
TYPE(42)
This function assesses the number 42 and returns 1, indicating that the input is a number. Result: 1
Example #3
TYPE(TRUE)
This function evaluates the boolean value TRUE and returns 4, indicating that the input is a boolean type. Result: 4
Error handling
- VALUE!: This error occurs if the function receives a value that is not recognized, such as an empty reference.
- REF!: This error pops up if the referenced cell does not exist or is invalid.