T function

The T function returns the text of a value, passing through text unchanged and yielding an empty string for non-text inputs.

=T(value)

Generate a T formula

Describe what you need. The generator will reach for T where T is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How T reads its arguments
valuerequiredT
ArgumentRequiredDescription
valueRequiredAny type – number, text, date, boolean, error or reference – T returns the text if it is text, otherwise an empty string; error values are propagated.

Returns

It returns a single-cell text string (or an empty string) matching the shape of the argument.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Extract employee name as plain text

Employee IDNameDepartmentHire DateSalaryStatus
101Alice SmithSales2015-06-0175000Active
=T(B2)

Result: Alice Smith

Cell B2 contains the text "Alice Smith". Because the argument is already text, T simply returns it unchanged. This is useful when you want to guarantee that a value is treated as a string in further concatenations. If B2 held a number, T would have returned an empty string instead.

2. Remove numeric salary from a text-only list

Employee IDNameDepartmentHire DateSalaryStatus
101Alice SmithSales2015-06-0175000Active
=T(E2)

Result:

E2 stores the numeric salary 75000. T evaluates the type of the argument, sees a number, and therefore returns an empty string. This behaviour allows you to filter out numbers when building a list of names or departments, because the empty string contributes nothing to a concatenated result.

3. Propagate a lookup error for status

Employee IDNameDepartmentHire DateSalaryStatus
105Eve TorresFinance2021-11-0369000#N/A
=T(F5)

Result: #N/A

F5 contains the error value #N/A, which typically arises from a failing VLOOKUP or similar function. T does not suppress error values; it passes them through unchanged. This makes T safe for debugging because you can see the original error rather than an empty string that might mask the problem.

Common errors

Which T error are you seeing?
T returned an error#N/A
Correct the lookup range or wrap the call in IFERROR to supply an alternate value.
#REF!
Restore the missing cells or adjust the reference so it points to a valid location.
#VALUE!
Fix the underlying formula that generates the #VALUE! error, or use IFERROR to replace it with a harmless value before calling T.
ErrorWhy it happensHow to fix it
#N/AThe argument evaluates to the #N/A error, for example when a VLOOKUP cannot find a matching record.Correct the lookup range or wrap the call in IFERROR to supply an alternate value.
#REF!The reference supplied to T points to a cell that has been deleted or to an invalid range, producing a #REF! error.Restore the missing cells or adjust the reference so it points to a valid location.
#VALUE!The argument contains a #VALUE! error, often caused by an underlying formula that tries to perform an illegal operation on mismatched types.Fix the underlying formula that generates the #VALUE! error, or use IFERROR to replace it with a harmless value before calling T.

Tips and when to use something else

  • Use T when you need to strip numbers, dates, or booleans from a range before concatenating with TEXTJOIN or CONCAT.
  • Combine T with IF: =IF(T(A2)="","No name",T(A2)) to replace empty results with a placeholder.
  • Remember that T returns an empty string (""), not zero or FALSE, so it behaves correctly in string-building contexts.
  • If you need to turn a numeric salary into formatted text, use TEXT instead of T because T will discard the number.

Frequently asked questions

What does T return when the cell contains a date?
Dates are stored as serial numbers, which are numeric values. T treats them as non-text, so it returns an empty string. If you need the date displayed as text, wrap the cell in TEXT with a date format.
Can T be used to test whether a cell contains any text?
Yes. Because T returns the original text or "" for everything else, you can test the result with =T(A1)<>"". A TRUE result means A1 held text, while FALSE indicates a number, date, boolean, or blank.
Why does T sometimes give back an error instead of an empty string?
T never hides error values; it propagates them unchanged. This design lets you see that the source cell is already in an error state, which is often more helpful than silently converting the error to an empty string.
Is there any advantage of using T over the TEXT function?
T simply returns text unchanged and discards everything else, whereas TEXT converts numbers, dates, and other types into formatted strings. Use T when you only want to keep existing text and ignore other data types; use TEXT when you need to transform numbers or dates into a specific textual representation.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator