Text function

T function

Returns the value if it is text, or an empty string if it is a number, date, logical value or anything else.

Available in All versions of Excel, including Microsoft 365, Excel for Mac and Excel for the web

In every Excel versionWorks in Google Sheets

Syntax

T(value)
ArgumentWhat it means
valueRequiredThe value or cell to test.

Returns: The text itself, or "" (empty text) for any non-text value.

How T works

T is a tiny filter: if the value is text it passes through unchanged; if it is anything else - a number, a date, TRUE/FALSE - you get an empty string instead. Error values are not filtered; they pass through as errors.

Most workbooks never need T, because Excel converts values automatically. It exists mainly for compatibility with other spreadsheet programs and is occasionally useful when you want to show a label from a column that mixes text and numbers but ignore the numbers, or to clean up a column before joining it with other text. Its partner N does the opposite job for numbers. To test for text rather than filter it, use ISTEXT.

Examples

1Text passes through

C2fx=T(A2)
ABC
1ItemQty
2Pens42Pens

Result: Pens

A2 holds text, so T returns it unchanged.

2Numbers are dropped

C2fx=T(B2)
ABC
1ItemQty
2Pens42

Result:

B2 holds the number 42, so T returns empty text and the cell looks blank.

3Labels only from a mixed column

B3fx=T(A3)
AB
1Note
2Back-ordered
315
4Discontinued

Result:

Filled down column B, T shows the text notes and blanks out the stray number 15 in A3.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 15 KB

Tips

  • T does not convert numbers to text; use TEXT or A2&"" for that.
  • Use ISTEXT when you need TRUE/FALSE instead of the value itself.

Google Sheets

T also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

T in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
RussianТ
TurkishM