30 Advanced Excel Tips for 2026

Excel Champs / Excel Basics / Excel String (Text) Functions
By Puneet Gogia (Microsoft MVP)

Excel String (Text) Functions

30+ Advanced Excel Tips for 2026

No spam. Only Excel Stuff. God Promise. 😊

In Excel, there are multiple string (text) functions that can help you to deal with textual data. These functions can help you to change a text, change the case, find a string, count the length of a string, etc. In this post, we have covered the top text functions. (Sample Files)

1. LEN Function

LEN function returns the count of characters in the value. In simple words, with the LEN function, you can count how many characters there are in a value. You can refer to a cell or insert the value in the function directly.

Syntax

LEN(text)

Arguments

  • text: A string for which you want to count the characters.

Example

In the below example, we have used LEN to count the characters in a cell. “Hello World” has 10 letters and a space between the words, and we have got 11 in the result, as LEN counts spaces too.

excel-len-function-example-1

In the below example, “22-Jan-2016” has 11 characters, but LEN returns 5.

excel-len-function-example-2

The reason behind it is that a date is stored as a number (here, 42391), and the LEN function counts the characters in the value of a cell, not in the formatted text you see.

Related: How to COUNT Words in Excel

2. FIND Function

FIND function returns a number which is the starting position of a substring in a string. In simple words, by using the FIND function, you can find (case-sensitive) a string’s starting position in another string. FIND doesn’t support wildcards; use SEARCH for that.

Syntax

FIND(find_text,within_text,[start_num])

Arguments

  • find_text: The text which you want to find from another text.
  • within_text: The text from which you want to locate the text.
  • [start_num]: The character position to start the search from. It’s optional, and 1 by default.

Example

In the below example, we have used FIND to locate the “:” and then, with the help of MID and LEN, we have extracted the name from the cell. TRIM removes the space after the colon:

=TRIM(MID(A1,FIND(":",A1)+1,LEN(A1)))

If the text doesn’t have a “:”, FIND returns the #VALUE! error. Wrap the formula in IFERROR to show something else instead.

3. SEARCH Function

SEARCH function returns a number which is the starting position of a substring in a string. In simple words, with the SEARCH function, you can search (not case-sensitive) for a text string’s starting position in another string. SEARCH also supports the wildcards * and ?.

Syntax

SEARCH(find_text,within_text,[start_num])

Arguments

  • find_text: A text which you want to find from another text.
  • within_text: A text from which you want to locate the text. You can refer to a cell, or you can input a text in your function.
  • [start_num]: The character position to start the search from. It’s optional, and 1 by default.

Example

In the below example, we are searching for the letter “P”, and we have specified start_num as 1 to start our search. Our formula returns 1 as the position of the text.

excel-search-function-example-1

But, if you look at the word, we also have a “P” in the 6th position. That means the SEARCH function only returns the position of the first occurrence of a text after the start position. To get the second “P”, use a start_num after the first one (like 2).

4. LEFT Function

LEFT function returns sequential characters from a string, starting from the left side (the start). In simple words, with the LEFT function, you can extract characters from a string from its left side.

Syntax

LEFT(text,num_chars)

Arguments

  • text: A text or number from which you want to extract characters.
  • [num_chars]: The number of characters you want to extract. It’s optional, and 1 by default.

Example

In the below example, we have extracted the first five digits from a text string using LEFT by specifying the number of characters to extract.

excel-left-function-example-1

In the below example, we have used LEN and FIND along with the LEFT to create a formula that extracts the name from the cell.

excel-left-function-example-2

5. RIGHT Function

The RIGHT function returns sequential characters from a string, starting from the right side (the end). In simple words, with the RIGHT function, you can extract characters from a string from its right side.

Syntax

RIGHT(text,num_chars)

Arguments

  • text: A text or number from which you want to extract characters.
  • [num_chars]: The number of characters you want to extract. It’s optional, and 1 by default.

Example

In the below example, we have extracted 6 characters using the RIGHT function. If you know how many characters you need to extract from the string, you can simply extract them by using a number.

excel-right-function-example-1

Now, look at the below example, where we have to extract the last name from the cell, but we are not sure about the number of characters in the last name.

excel-right-function-example-2

So, we are using LEN and FIND to get the name. Let me show you how we have done this.

First of all, we have used the LEN to get the length of that entire text string, then we used the FIND to get the position of the space between the first and last names. And in the end, we have used both figures to get the last name.

How the Formula Works

  • LEN: Gives the total number of characters in the full name.
  • FIND: Gives the position of the space. Subtracting it from the total length gives the number of characters after the space, which is what RIGHT extracts (formula below this list).
=RIGHT(A1,LEN(A1)-FIND(" ",A1))

6. MID Function

MID returns a substring from a string using a specific position and number of characters. In simple words, with MID, you can extract a substring from a string by specifying the starting character and number of characters you want to extract.

Syntax

MID(text,start_num,num_chars)

Arguments

  • text: A text or a number from which you want to extract characters.
  • start_num: A number for the position of the character from where you want to extract characters.
  • num_chars: The number of characters you want to extract from the start_num.

Example

In the below example, we have used different values:

  • From the 6th character to the next 6 characters.
  • From the 6th character to the next 10 characters.
  • We have used a negative starting character, and it has returned an error.
  • We have used 0 for the number of characters to extract, and it has returned a blank.
  • We have used a negative number for the number of characters to extract, and it has returned an error.
  • The starting number is zero, and it has returned an error.
  • Text string directly into the function.
excel-mid-function-example-1

7. LOWER Function

LOWER returns the string after converting all the letters to small letters. In simple words, it converts all the letters in a text string to lowercase, and numbers stay intact.

Syntax

LOWER(text)

Arguments

  • text: The text which you want to convert to lowercase.

Example

In the below example, we have compared the lower case, upper case, proper case, and sentence case with each other.

excel-lower-function-example-1

A lower case text has all the letters in a small case compared to others.

8. PROPER Function

The PROPER function returns the text string in proper case. In simple words, with the PROPER function, the first letter of each word is in capital and the rest are in small letters (proper case).

Syntax

PROPER(text)

Arguments

  • text: The text which you want to convert to the proper case.

Example

In the below example, the proper case has the first letter of each word in capital and the rest of the letters in lowercase, compared to the other two cases, lowercase and uppercase.

excel-proper-function-example-1

In the below example, we have used the PROPER function to convert first names and last names into the proper case.

Just note that PROPER capitalizes every letter that comes after a character that isn’t a letter. So, “o’neil” becomes “O’Neil” (good), but “it’s” becomes “It’S” and “2nd” becomes “2Nd”.

excel-proper-function-example-2

9. UPPER Function

The UPPER function returns the string after converting all the letters to capital letters. In simple words, it converts all the letters in a text string to uppercase, and numbers stay intact.

Syntax

UPPER(text)

Arguments

  • text: The text which you want to convert into uppercase.

Example

In the below example, we have used the UPPER to convert name text to capital letters from the text in which characters are in different cases.

excel-upper-function-example-1

10. REPT Function

REPT function returns a text value repeated several times. In simple words, with the REPT function, you can specify a text and a number of times to repeat that text.

Syntax

REPT(text,number_times)

Example

In the below example, we have used different types of text for repetition using REPT. It can repeat any text, numbers, and even symbols that you specify in the function, and the main use of the REPT function is for creating in-cell charts.

excel-rept-function-example-1

For example, the following formula draws a bar of “|” characters, one for every 10 units in A1. If number_times has decimals, REPT uses only the whole number, and the result can’t be longer than 32,767 characters.

=REPT("|",A1/10)

More Text Functions in Newer Excel

  • TRIM: removes extra spaces from a text and leaves single spaces between words (all versions).
  • SUBSTITUTE: replaces a specific text with another text (all versions).
  • CONCAT and TEXTJOIN: join texts from a range, TEXTJOIN with a delimiter (Excel 2019 and later).
  • TEXTBEFORE, TEXTAFTER and TEXTSPLIT: get the text before or after a delimiter, or split a text into cells, without FIND and MID (Microsoft 365 and Excel 2024).

For example, in Microsoft 365, you can get the last name from the RIGHT example above with this shorter formula:

=TEXTAFTER(A1," ")

Frequently Asked Questions

FIND is case-sensitive and doesn’t support wildcards. SEARCH isn’t case-sensitive and supports * and ?. Both return #VALUE! when the text isn’t found.

Why does LEFT or RIGHT return a number as text?

All the text functions return text, even when the result looks like a number. Wrap the formula in VALUE (or add –) to turn it into a real number.

Do text functions change the original cell?

No. They return the result in the cell where you enter the formula. To replace the original values, copy the results and paste them as values over the original data.

Puneet Gogia

Written by

Puneet Gogia

Microsoft MVP — Excel · Founder, Excel Champs

Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.

3M+ readers helped
1,000+ tutorials written
Since 2015 teaching Excel

2 thoughts on “Excel String (Text) Functions”

  1. Hi

    Is possible to sum all WA11?

    (A1) WA11 4

    (A2) AdBlue 1, WA11 223

    (A3) AdBlue 3, WA11 32, shift 4

    … and everything is in one column.

    Thanks you very much for your help.

    Sincerely Marko

    Reply
  2. Your example formula in section 4 regarding returning the first name doesn’t work appropriately if you use a name like “Peter Jay”. It’s only working appropriately because the last name of each example is exactly one character longer than the first name. If you use =LEFT(B2,FIND(” “,B2)-1) that will return the first name regardless of the length of the first name or last name.

    Reply

Leave a Comment