T
Syntax:¶
T(value)
- value: The value you want to test and return as text.
Description:¶
The T function in Excel checks whether a value is text and returns it if true. If the value is not text (e.g., a
number, date, or logical value), it will return an empty string (""). This function is primarily used in scenarios
where you need to extract or validate text from a mixed dataset.
Examples:¶
-
=T("Hello")
Result:"Hello". Since the input is already text, the function returns it as-is. -
=T(1234)
Result:"". Numbers are not considered text, so an empty string is returned. -
=T(TRUE)
Result:"". Logical values likeTRUEorFALSEare not text, so the function returns an empty string. -
=T("1234")
Result:"1234". Even though this input looks like a number, it's treated as text because it is enclosed in quotation marks. -
=T(A1)
Result: Depends on the content of cellA1. If the value inA1is text, it will be returned. Otherwise, an empty string will be output.
Notes:¶
- The
Tfunction is rarely used in modern Excel because logical functions (likeIForISNUMBER) and text functions (likeISTEXT) often offer more practical alternatives. - It is mainly included for compatibility with older versions of Excel.
- When working with calculations involving both text and non-text values, consider using this function to filter and handle text values explicitly.
- If the value is blank (completely empty),
Twill return an empty string, too.