Category: FUNCTION | Updated: 2026-11-22

How to Use the T Function in Google Sheets | Return Text Only If the Value Is a String

How to Use the T Function

The T function returns the text string as-is if the specified argument is text, and returns an empty string ("") if it is any other data type (such as a number or date).

Syntax

=T(value)
  • value: The value or cell reference to check for text (required).

Examples

Here is an example of extracting only text values from a list containing numbers, dates, and strings.

Row Column A (Input Data) Column B (Formula) Column C (Result)
1 Input Data Formula Result
2 Taro Yamada =T(A2) Taro Yamada
3 12500 =T(A3) (Blank)
4 2026/11/22 =T(A4) (Blank)
5 ’00123 =T(A5) 00123
  • Explanation: The text string in row 2 and the number stored as text with a leading apostrophe (') in row 5 are returned, while the number in row 3 and the date in row 4 become blank.

Common Errors and Tips

  • Error values are passed through: If the referenced cell contains an error like #N/A or #DIV/0!, T returns that same error.
  • Does not convert numbers to text: To convert a number into a text string, use TO_TEXT or TEXT instead of T.
  • Numbers formatted as “Plain text” are returned: Digits in a cell formatted as Plain Text are treated internally as text strings, so T returns them.

Frequently Asked Questions

Q. What happens if I pass a cell containing a number or date to the T function?

A. Because numbers, dates, and booleans (TRUE/FALSE) are not text strings, no error is thrown and an empty string ("") is returned.

Q. When is the T function useful?

A. It is helpful when you want to extract only text entries from a column containing mixed numbers and text, or ensure a value is handled strictly as text inside a formula.