T


Returns the given text, or an empty text string if the target is not text.

Syntax:

T(value)

if value is text, it is returned.if value is a number or a logical value, an empty text string "" is returned.

Example:

T("red car")

returns red car.

T(123.4)

returns an empty text string.

ISTEXT(T(123.4))

returns TRUE.

T(NA())

returns the #N/A error. Errors are propagated.


Application:

Scenario: You have a list of sales data. Some cells in the "Notes" column contain actual text notes, while others contain numerical codes or are empty. You want to create a new column that only shows the actual text notes and leaves everything else blank.


Table:

Order ID

Product

Notes

Text Notes Only

A
B
C
D
1
1001
Laptop
Needs expedited shipping.
Needs expedited shipping.
2
1002
Monitor
501
 
3
1003
Keyboard
Special instructions for delivery.
Special instructions for delivery.
4
1004
Mouse
6
 
5
1005
Webcam
 
 

Explanation:

In this example, the formula used in the "Text Notes Only" column (cell D2) is:

T(C1)

  • T(C1): The T function checks the value in cell C1.
  • For row 1 (Order 1001): Cell C1 contains the text "Needs expedited shipping.". Since this is text, the T function returns "Needs expedited shipping.".
  • For row 2 (Order 1002): Cell C2 contains the number 501. Since this is not text, the T function returns an empty string ("").
  • For row 3 (Order 1003): Cell C3 contains the text "Special instructions for delivery.". The function returns this text.
  • For row 4 (Order 1004): Cell C4 contains the number 6. The function returns an empty string.
  • For row 5 (Order 1005): Cell C5 is empty. The T function treats this as non-text and returns an empty string.


This simple function helps you to quickly and automatically filter out non-text values, which is particularly useful when you have a mixed data type in a single column and you only want to work with the text data.





This page is protected by Google reCAPTCHA. Privacy - Terms.
 
Built using Zapof