Excel T Function – How To Use

The T function is a text function that determines whether the input data is text or not. If the data is a text value, the function returns the input data in its original form whereas it results in an empty string for all non-text input values.

The T function is highly beneficial when we wish to eliminate values that are not text making it easier to create consistent datasets.

Excel T Function

Syntax

The syntax of the T function is pretty straightforward and is as follows.

=T(value)

Arguments:

The T function only accepts one argument.

'value' – This mandatory argument holds the data that we need to test as to whether it is text or not. It can be a direct value, a cell reference, or a return value from a function.

Important Characteristics of the T Function

Some of the notable features of the T function are as follows.

  • The T function returns an empty string for all non-text input values except error values. If the data in the value argument is an error message, the T function returns the value as it is.
  • The T function is also one of the only two functions in Excel where the name of the function is only one character.

Examples of T Function

The T function is a very simple and elementary function of Excel. Let's go through a few examples to better understand its usage.

Example 1 – Simple Use of T Function

In this example, we have taken a dataset containing different types of values to get familiar with the functionality of the T function.

Simple Use of T Function

The varying input data includes text, numerical value, Boolean, zero, date, time, and an Excel error. Let's see how each data behaves with the T function. The formula used will be as follows.

=T(B3)
Simple Use of T Function

As we can see in the first two examples, the functionality of the T function is clear. It returns the first value 'Excel' as it is while, in the second example, an empty cell is returned as the input data is a number.

The third example is a Boolean value, and the T function returns an empty cell indicating that the input data is not a text value. A similar pattern is observed for the subsequent examples, where date and time are also considered numerical values due to the way they are stored in Excel. Therefore, an empty cell is returned.

In the last example, the input value is an error. As we can see from the return value in cell C9, the T function returns the input value with no change.

It is now obvious that the T function only accepts text and error values and returns the same as the resulting data. For all other data, the function returns an empty cell. Let's explore more examples to find applications of the said function.

Example 2 – Combining Only Text Values Using T Function

In this scenario, we extracted the employee information from the database to combine the details for the complete mailing address. As the data was extracted from the database, the empty fields contain 0.

Combining Only Text Values Using T Function

If we wish to simply combine the above cells using the '&' ampersand or CONCAT function, the formula used will be as follows.

=CONCAT(B3,C3,CHAR(10),D3,E3,F3)

We have added the CHAR function to insert a line space after the name for better visibility. Turn the Wrap Text feature (in the Home tab, Alignment group) on for the line break to apply in the results.

Combining Only Text Values Using T Function

As we can see, the resulting data in column G also includes the zeros (0) from the cells. To ensure that only text values are included, we can pass each value through the T function and then combine them. The formula used will be as follows.

=CONCAT(T(B3),T(C3),CHAR(10),T(D3),T(E3),T(F3))
Combining Only Text Values Using T Function

Now, we have the complete mailing address, which excludes unnecessary data.

Example 3 – Accepting Only Text Values using T Function

As the T function only accepts text values, one of the best use cases of the function is to test if the user-entered value is a text or not. Suppose we are collating user-generated information that is to be further processed in forms. The only condition is that the information must be in text.

Here we have designed a simple form where the user can enter their name and profession.

Accepting Only Text Values using T Function

In a separate column, we can use the T function to check if the data entered is text or not. If the entered data is text, the data collection column displays it, otherwise, it shows a blank cell. The formula used will be as follows.

=T(C2)
Accepting Only Text Values using T Function

It works as expected. A similar result can be achieved using the ISTEXT function which returns true or false.

T Function vs N Function

The T function is a text identifier while the N function is a number identifier. The T function only returns the text values and therefore can be used to remove non-text data, whereas the N function can be used to remove the text data.

An additional feature of the N function is that it also converts the numeric data from the text format to its original numerical form. Let's understand the contrast with an example.

Here we have taken three types of data as the input value which are text, number, and date.

T Function vs N Function

As observed in column C, the T function returns the text value in the same form while returning an empty string for number and date.

In column D, the N function returns 0 instead of an empty string for a non-numeric value. The N function returns the number as it is while changing the date format to its original sequential numbers.

Although both functions are elementary, they are very useful when dealing with large data and improve compatibility with other spreadsheet programs.

We hope this Excel function tutorial has provided you with valuable insights and greatly enhances your efficiency when working with large amounts of data. Keep an eye out for more upcoming tutorials and tips to take your Excel skills to the next level!

About Shubhra Jain

Meet Shubhra Anand Jain, a dedicated Excel enthusiast with over 5 years of expertise, specializing in data analysis, complex formula development, and automation. Based in Sweden, she's on a mission to simplify Excel, one formula at a time. Check out Shubhra's extended profile here.