Microsoft Excel comes with a massive list of functions that allow you to manipulate the text data within a spreadsheet, and even add features that you may have thought were impossible. In the following tutorial, we will show you exactly how to do that using Excel’s text functions. 

How to Access the Excel Functions

As mentioned above, functions are what allow you to manipulate data in your spreadsheet in some capacity. Whenever you need to access a function, you can do so in a few different ways. 

Microsoft Excel – Excel from Beginner to Advanced

Last Updated May 2021

Bestseller
  • 215 lectures
  • All Levels
4.6 (242,557)

Excel with this A-Z Microsoft Excel Course. Microsoft Excel 2010, 2013, 2016, Excel 2019 and Office 365 | By Kyle Pew, Office Newb

Explore Course

One option is to add a function to a cell using the equal sign. Simply click on the cell where you want to apply the function and type “=” directly in the cell. This should bring up a list of functions available for use in the spreadsheet. You can get to the function you’re looking for by typing its first letter after the equal sign. Since we’re looking for text functions, we would enter “=T” in a cell to view a list of functions starting with ‘T.’ 

Look at the following image to see how that would look in Excel.

Notice that it gives you a complete list of functions that start with “T.” When you access the function through this method, Excel will provide the syntax as a guide for you to follow when creating your formula.

An easier way to access a function in Excel is using the Formulas tab on the menu in Excel. All you have to do is click on the Formulas tab and choose the function you wish to apply. You’ll see the Text menu option under the Formulas tab contains several text functions. 

Take a look at the screenshot below:

When you access the function via the Formulas tab, Excel brings up the formula wizard to help you create the formula you need. If you are new to working with formulas, then using the formula wizard is a quick and easy way to learn how to create them.

Formatting dates with the Excel text function

For our first example, we’re going to use the formula wizard to convert the following dates into formatted text. We’ll base all of our examples on the spreadsheet below. 

To convert the first date to a text field, click on cell B2. This is where we want our formatted text to display. Then open the text formula via the Formulas tab. Choose cell A2 in the value field to convert the first date, then type “m” in the format text field to convert the date to a single-digit number representing the month.

Now let’s add some more date formatting with the wizard. If we type “mm” instead of “m,” the text will appear as a double-digit month:

If we type “mmm,” the text will appear as “Dec”:

The advantage of using the formula wizard is that it tells you what formula to use, which cell to use, and gives you a preview of what the formatted cell will look like at the bottom left-hand corner of the wizard:

Below the preview of the formula is a link to the help function that gives you all the text formulas that you can use to format a date cell as text within a cell.

Formatting numbers with the Excel TEXT function

The Excel TEXT function also lets you format numbers. Excel provides three characters so you can format numbers as text. They are the zero character, the hash character, and the question mark. Each has a different effect on the numbers being formatted.

The zero character displays the number as-is unless there are fewer digits than the format, in which case it places a zero within the text display of the number. Look at the example below. We are going to format 7.5 as a text value using the 0.00 mask. You can see in the second example that Excel adds a zero to the end of the number 7.5 because the number does not have sufficient digits.

The result of the above format on our two numbers is as follows:

Using the zero mask to format numbers is a great way to standardize how the numbers look in your worksheet.

The hash mask removes excess zeros if they appear in front of a number or after a decimal point at the end of the number. If you format the above numbers using the “##,##” mask, then you would see the following result:

And finally, the question mark mask aligns the numbers using the decimal point of each number. Using “??.??” to format the above numbers would have the same results as using the hash marks.

You may also use the zero, hash, and question mark in combination to format numbers as text in a spreadsheet. If we used the “$000,###” mask to format our numbers, then we would end up with the following result:

As you can see from the examples, the Excel TEXT function is a powerful way of converting numbers and dates to text. One thing to remember, though, is once you format the date or number as text, you cannot use it for calculations like you could the original numbers.

But as you may have noticed when you looked at the list of text functions in the Formula Builder, there are many more functions under the text heading. Let’s look at those functions next.

Other top Excel text functions

The TEXT function can take numbers and format them into text-based dates, currency, and many other formats, but there may be more you want to do with the text in your spreadsheets. Here are some other Excel text functions you might find helpful. You can add any of the following functions to your spreadsheet using the two methods mentioned above. Excel text functions become even more powerful when you use them together. We will now look at a few examples of both using them by themselves and in combination with other functions.

The Excel FIND function

The Excel FIND function returns the position of one text string inside another as a number. Here is the syntax for the FIND function:

FIND (find_text, text_to_search, [start_num])

Here are the parameter definitions:

•      find_text – The text to find.

•      text_to_search – The text to search.

•      start_num – [optional] The starting position in the text to search. By default, it starts at 1.

So if we had a cell called A2 that has the value of “Independence” in it, we could use the following formula in another cell:

FIND('n', A2)

This formula would return 2.

The FIND function is often combined with other Excel functions, for example, to extract the first name of a person from a full name. First, you would find the first space in the string, which will return a number. Then you can use that number along with the Excel LEFT function to retrieve the first name. We will look at that more in detail when we look at the LEFT function next.

The Excel LEFT function

The Excel LEFT function returns a specific number of characters from the left side of a string as specified by the user. Here is the syntax for the Excel LEFT function:

LEFT (text, [num_chars])

Here are the definitions of the parameters:

•      text – The text to extract characters from.

•      num_chars – [optional] The number of characters to extract, starting on the left side of the text. The default number is 1.

For an example of using LEFT, let’s say that we have a worksheet that has full names in one column, and we want to extract the first name into another column. In other words, we want to extract all the characters before the space that separates the first name and the last name.

So if the name “Bob Smith” is cell A2, we first need to find the space. Here is the formula we need to do that:

FIND (" ",A2)

Then we can use the numeric value that this returns in a LEFT function to extract the first name:

LEFT (A2, FIND(" ",A2) - 1)

Since the FIND function we used will return the location of the space, we subtract one from the value it returns to get the position of the last letter of the first name. For the cell containing “Bob Smith,” this formula will return “Bob.”

The Excel LEN function

The Excel LEN function is a simple function that returns the number of characters in a string. Here is the syntax of the Excel LEN function, where text is the string we want to calculate the length:

LEN (text)

If we run this function on the cell A2 that has the text “Bob Smith,” it would look like this:

LEN (A2)

For “Bob Smith,” this would return 9. When we look at the RIGHT function next, we will use the LEN function and the FIND function in combination with it to extract last names from a list of full names.

The Excel RIGHT function

The Excel RIGHT function is similar to the Excel LEFT function except that it returns a specific number of characters that a user specifies from the right side of the string instead of from the left side. Here is the syntax for the Excel RIGHT function:

RIGHT (text, [num_chars])

Here are the definitions of the parameters:

•      text – The text to extract characters from.

•      num_chars – [optional] The number of characters to extract, starting on the left side of the text. The default number is 1.

Since we already use the Excel LEFT function to extract the first name from a full name, let’s use the RIGHT function to extract the last name. We will have to use the LEN function first to get the entire length of the name.

LEN (A2)

We can also use the FIND function to find the location of the space in the full name just like we did to retrieve the first name:

FIND (" ", A2)

We can finally use the values that these two functions return, along with the RIGHT function to extract the last name.

RIGHT (A2, LEN (A2) - FIND (" ", A2))

If we had “Bob Smith” in cell A2, this would return “Smith.”

The Excel MID function

The Excel MID function is similar to both the LEFT and RIGHT functions and is useful if you want to extract text from the middle of a string. Here is the syntax for the MID function:

MID (text, start_num, num_chars)

Here are the definitions of the parameters:

•      text – The text to extract data from.

•      start_num – The location of the first character to extract.

•      num_chars – The total number of characters to extract.

We can actually use the MID function to return the first name from a cell that contains both first and last names if we need to, since we know we need to start with the first character and stop a character before the first space. Here is how we would create a formula to extract the first name from cell A2, which contains the name “Bob Smith.” Here is that formula:

MID (A2, 1, FIND(" ",A2) - 1)

This would return “Bob,” just like the example of using the LEFT function.

The Excel TRIM function

The Excel TRIM function is a useful function for normalizing the text data in your spreadsheet. TRIM will automatically remove space at the start and end of a given string, leaving only one space between all the words in the string. Here is the syntax of the TRIM function:

TRIM (text)

Above, text refers to the string that you want to remove whitespace from. So if you have “The Sun Also Rises” in the A2 cell of a spreadsheet and apply the following formula to another cell, it would look like this:

TRIM (A2)

This would return “The Sun Also Rises.”

The Excel PROPER function

The Excel PROPER function converts text to title case. In other words, it sets the first character of each word to uppercase and all the other letters to lowercase. Here is the syntax of the PROPER function:

PROPER (text)

In this case, text is the string that you want to convert. This function would have been convenient in our list of names if we didn’t already capitalize them. If we had “bob smith” in cell A2 of a worksheet, we could use the following formula to convert it to “Bob Smith”:

PROPER (A2)

The Excel UPPER function

The Excel UPPER function also changes the case of characters in a string. It will convert all the text passed to it to uppercase. The syntax of the UPPER function is the following:

UPPER (text)

The text within the parentheses is the string that you want to convert to uppercase. If we had “John Smith” in cell A2 of an Excel worksheet, the following formula would convert it to “JOHN SMITH”:

UPPER (A2)

The Excel LOWER function

The Excel LOWER function also changes the case of characters in a string. It will convert all the text passed to it to lowercase. The syntax of the LOWER function is the following:

LOWER (text)

The text here indicates the string that you want to convert to lowercase. If we had “Jim Smith” in cell A2 of an Excel worksheet, the following formula would convert it to “jim smith”:

LOWER (A2)

Top courses in Office Productivity

Google Sheets – The Comprehensive Masterclass
Leila Gharani
4.8 (1,575)
Bestseller
Microsoft Excel – Advanced Excel Formulas & Functions
Maven Analytics, Chris Dutton
4.6 (51,141)
Bestseller

More Office Productivity Courses

The Excel SUBSTITUTE function

The Excel SUBSTITUTE function will replace text found in a given string with other text. Here is the syntax of the Excel SUBSTITUTE function:

SUBSTITUTE (text, old_text, new_text, [instance])

Here is the definition of the parameters:

•      text – The text you want to modify.

•      old_text – The text to replace.

•      new_text – The text to replace it with.

•      instance – The specific instance to replace. This is optional, but note that Excel will replace every single instance the word appears with the new_text if the parameter doesn’t have an instance. 

An example of using SUBSTITUTE would be a spreadsheet with a column of phone numbers. If the phone numbers have dashes in them and you wanted to remove them, you could use the following formula:

SUBSTITUTE (A2, "-", "")

There is not much to the formula, but if we have 888-888-8888 in cell A2, it will return 8888888888.

Conclusion

The data in an Excel spreadsheet may not look the way you want it to. Dates and numbers may not have a consistent format. Some values may have extra spaces in them. Excel text functions allow you to format the data in your worksheets the way you want them to look. The Excel TEXT function is helpful for formatting dates, currency, and other numbers. For more advanced text formatting, you can browse the text section of the Excel Formula Builder and find useful functions like FIND, LEFT, RIGHT, and others that will take your Excel text formatting to the next level.For more information on the advanced use of Excel, check out our overview of the most important functions that every professional should know. If you’re ready to take a closer look at another function, let’s move on to the SUMIF statement.

Top courses in Excel

Microsoft Excel: Practical MS Excel + MS Excel data analysis
- Six Sigma Academy Amsterdam -
4.6 (992)
Microsoft Excel - Excel from Beginner to Advanced
Kyle Pew, Office Newb
4.6 (242,557)
Bestseller
Microsoft Excel - Data Analysis with Excel Pivot Tables
Maven Analytics, Chris Dutton
4.6 (28,761)
Bestseller
Microsoft Excel - Data Visualization, Excel Charts & Graphs
Maven Analytics, Chris Dutton
4.6 (23,446)
Bestseller
Microsoft Excel Pro Tips: Go from Beginner to Advanced Excel
Maven Analytics, Chris Dutton
4.6 (2,640)
Bestseller
Microsoft Excel Certification Exam Prep: MO-201 Excel Expert
Maven Analytics, Enrique Ruiz
4.6 (428)
Bestseller
Data Analysts Toolbox: Excel, Python, Power BI
Simon Sez IT
4.5 (213)
Bestseller

More Excel Courses

Excel students also learn

Empower your team. Lead the industry.

Get a subscription to a library of online courses and digital learning tools for your organization with Udemy for Business.

Request a demo