| Syntax |
| =T(value) |
| Purpose / Description |
| Returns the text string value of a value, filtering non-text string values. |
| Arguments |
| Name |
Type |
Description |
| value |
any |
A constant, reference or nested expression that returns a value from which the text string value is returned. |
| Return Values |
| Type |
Specific Value |
Description |
| text string |
|
The text string value of the value passed to the value argument. If multi-cell range, only the result for the first cell in the range is returned. |
| text string |
"" (empty string) |
If the value of the value argument is a blank cell, a logical or a number, an empty string is returned. That is, a string containing no characters, represented in formulas as "". |
| error |
|
Any errors referenced by arguments are returned due to propagation of error values. |
| Notes / Comments / Advice / Warnings |
| Note: |
This function cannot be used with an array of values. In either dynamic or legacy arrays, a single value is returned, the value of the T of the first item in the array or multi-cell range. |
| Comment: |
It is noteworthy that the expression T(range) returns exactly the same answers as the longer and more common =IF(ISTEXT(range),range,""). |
| Advice: |
We use the T function extensively in our workbooks and in the course workbooks for our courses, as it is such a neat solution to a referencing a potentially blank range that should not show as 0 when the value is displayed prior to entry or calculation. |
| Advice: |
It is possible to use the T function with a multi-cell range if an nested array expression is used, since the array handling will call the function once for each value. However, the nesting of a more complex expression removes some of the simplicity, in which case the IF(ISTEXT()) approach mentioned above is probably simpler and more transparent. |
| Examples: |
Open / download sample workbook: T.xlsx |
| |