What is Text Function in Excel?
A text function (an Excel string function) is a built-in formula for modifying, locating and extracting
textual data in MS Excel.
Here are the different types of text functions in Excel with examples.
1. LEFT Function
2. RIGHT Function
3. MID Function
4. LEN Function
[Link] Function
[Link] Function
[Link] function
1. LEFT Function
The Left function extracts the desired amount of characters from the left of a text. For example, if we
want to extract four characters from the left of the text in cell B2, the syntax will be:
=LEFT(B2, 4)
Cell Data (B2) Formula Result
B2 WASH-2026-XP =LEFT(B2, 4) WASH
2. RIGHT Function
Similar to the Left function, this function helps to extract characters from the rightmost side of the
text. For example, to extract three characters from the right of the text in cell A2, the syntax is:
=RIGHT(A2, 3)
Cell A2 (Original Text) Formula Result Explanation
APP-105 =RIGHT(A2, 3) 105 Takes the last 3 digits.
California =RIGHT(A2, 3) nia Takes the last 3 letters.
3. MID Function
MID is an MS Excel text function that extracts characters from the middle of a string. The syntax for
extracting 7 characters from the middle of the text in B2, starting from the 5th character, is:
=MID(B2,5,7)
Spaces are included as characters in the MID function.
4. LEN Function
This Excel text function lists the length of characters in a given cell. The syntax for the example
below is as follows:
=LEN(B2)
5. TRIM Function
TRIM removes any extra spaces before the text or between the words written in a cell. The syntax for
the given example is:
=TRIM(B2)
6. CONCATENATE Function
This MS Excel text function merges the text from three or four cells. Suppose you want to join the
text in cells B2, C2 and D2, as given in the [Link] will combine the texts from these cells into
one cell without any spaces.
You can use the syntax:
=CONCATENATE(B2,C2,D2) or =CONCATENATE(B2,” “,C2,” “,D2)
You can add a space between the text in two cells by simply typing “ “
7. TEXTJOIN function
The TEXTJOIN function combines the text from multiple ranges and/or strings, and includes a
delimiter you specify between each text value that will be combined.
=TEXTJOIN(delimiter, ignore_empty, text1, [text2], …)