T function
T returns a value as is if it is text and returns an empty string for anything else. It is rarely needed in day-to-day work, and numbers become empty text rather than 0.
Example
Read it as a sentence: check F2, and since it holds text, give that text back, which gives 123.
Excel shows 123
F
1
2
'123
Data
Syntax
T(value)
-
value(required) - The value to test.
Returns: The value if it is text, otherwise an empty string.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=T("abc") | abc | Text |
=T(123) | Number | |
=T(TRUE) | Bool | |
=T(Data!F2) | 123 | Text number cell |
=T(Data!F1) | Blank | |
=T(Data!F3) | Date cell | |
=T(Data!F5) | #DIV/0! | Error |
The Data sheet these formulas read
A cell that starts with = holds that formula.
F
1
2
'123
3
2024-02-29
4
TRUE
5
=1/0
Data
Watch out for
- Numbers become empty text, not 0.
Where it works
- Excel
- T is in every version of Excel from 2007 on.
- Google Sheets
- Same name, same behaviour for everyday use.
Part of Text functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .