One of Excel’s strengths is the great job it does of working with text information. This is truly an invaluable section in your Excel training since dealing with text data and using text functions in Excel is fundamental to most professionals.
In this article I’m going to give an explanation of them, some examples and marks out of 10 for all the formulas.
First let’s look at formulas that cleanse text data. By cleansing, I mean making the piece of data appropriate to work with.
What follows is my assessment of all the text function formulas by giving them marks out of 10 based on their usefulness. This online Excel course will cover these formulas in greater depth.
TRIM (7/10) – Removes all unnecessary spaces in the text in a cell (apart from 1 space between words)
PROPER (6/10) – Makes the text in a cell lowercase apart from the first character and any character after a full stop
CLEAN (6/10) – Very useful when you bring data from another source (maybe you’ve pasted stuff from a website) and Excel doesn’t display some of the characters properly, resulting in nonsense, such as below. Let CLEAN take care of it for you!
A1 contains the following: “the correct values can be found at located at the areas in”
So, writing =CLEAN (A1) gives us “The correct values can be found at located at the areas in”
We got rid of the weird symbols but it did leave us with extra spaces, so as a rule when bringing data in, use the following combo:
=TRIM (CLEAN (A1)) which gives “The correct values can be found at located at the areas in”
If you look carefully, this has taken care of the extra spaces around where the symbols were.
SEARCH (8/10)/FIND (5/10) – These two Excel text functions look for a single character or a sequence of characters in a cell. The difference is FIND is case sensitive and SEARCH is case insensitive. This is the main reason I, and so should you as I explain in Excel classes, should always default to SEARCH. What you will end up with is the position number of where your character is (or string of characters start) so it acts a bit like the match function. If there is no number you will get an error (#value!). Continue reading this Excel training tutorial to understand the differences between SEARCH and FIND.
The structure of SEARCH/FIND are the same:
SEARCH (what character or sequential characters are you looking for? What/where shall I look? Shall I start looking from a certain number of characters in or if not I’ll start from the beginning)
There are 3 common uses of FIND/SEARCH. First is in combination with the left/right/mid functions, which I’ll address in a bit. Second is to help with rule building. Third, FIND/SEARCH can be used for quick and dirty analysis, possibly with auto filtering where you create a new column and see if for example the word “email” exists in some text, then where the formula produces a number rather than an error you can filter and investigate.
LEN (8/10) – This is short for length and it simply gives you a count of characters in a cell including spaces. For example, LEN (“hello”) results in 5. LEN (“12/02/2014”) results in 9 but LEN (12/02/2014) results in 5 because while Excel perceives “12/02/2014” as text, 12/02/2014 is a date, so behind the scenes Excel converts it to a serial number (41682) which has a length of 5.
These text functions are essential in most of your dealings with Microsoft Excel. This tutorial will cover not only their purposes but also how to practically implement them after you’ve engaged in this segment of my online Excel training.
LEFT, MID, RIGHT – These very useful formulas will extract characters from a cell.
LEFT (8/10) Always starts extracting from left to right. Here’s the structure:
LEFT (what/where is your text, how many characters shall I display starting from the left)
Let’s say we want to know the first 5 characters of a unique reference number as it implies some useful information, here’s how we do it:
MID (8/10) – This is like left in that it extracts looking left to right, but the difference is you can decide how many characters in you want to start. Here’s the structure:
MID (what/where is your text, how many characters in, how many characters shall I display starting from the left),
To keep the example simple, let’s say we have some unique references where the letters always give us region abbreviation and we know they occur 3 characters in.
RIGHT (8/10) – Always starts extracting from right to left. Here’s the structure:
RIGHT (what/where is your text, how many characters shall I display from the right).
This example wants to do a very simple check to see if the word “president” is contained in column A so we set a basic right formula to look at the last 9 characters. By making the whole thing equal to the word “president” we are creating a check. If they contain the characters “president” it will result in a true, otherwise we will get a false output.
That covers the basics, but before moving on I just want to give a simple example of how we can manipulate text data to make it fit for our purpose. This is important for any Excel course, as you need to know how to use your newfound knowledge on a practical basis. A classic example, something I encounter in most weeks at work, entails extracting certain words. For example, we want the first name of a person where names in a cell are in a ‘first name’ space ‘second name’ format. So how can we extract just the first name? What do all the names have in common? They all have a space between the first and second names. So, all we need to do is to use a formula to search for which number the space occurs:
Now if we put that number into a left formula and say count up to this many characters (-1 since we don’t want to include the space) then we have a way to automatically extract just the first name! Behold.
This is just a basic, but powerful example of some of the cool stuff Excel can do to handle text data.
Before ending this section on the best text functions in Excel, I may be lambasted by some for not rating the CONCATENATE function highly, whilst it does something very useful which is to join the contents of two or more cells/text/values, it has zero advantages over the ampersand operator (&) so don’t bother with it!
Excel Training Will Make You Privy to All of These Text Functions and More
To be a true Master of Microsoft Excel, one must have a thorough understanding of text functions. My online Excel training program will help you to excel at Excel. Soon you’ll be thriving under the full understanding of how text functions work within the program.