If you want to extract a part of text from a text string in Excel, you don’t need to look any further. With the three built in functions called LEFT, RIGHT and MID, you can extract any part of a text string you need.
The LEFT function let you to extract a certain characters from the left of a text string. To use this function, you need two arguments: the text string you want to extract text from and the number of character you want to extract.
How does LEFT, RIGHT and MID work?
Let’s look at the image below to see it clearer:
As you can see in the picture, we are extracting one character from the text in the cell D14. As you can guess, the result is the character I.
If you want to get more character, simply increase the number of character (for example, 4 instead of 1).
Now let’s look at the other two functions, RIGHT and MID.
RIGHT works exactly like LEFT in the opposite direction. If I write a function like this:
Can you guess the result?
It should be the letter “m” (without the quotes).
Now, let’s have a look at the MID function. Different from the LEFT and RIGHT functions, which take only two arguments, MID takes three arguments. The first one is the cell you want to extract text from. The second is the index of the beginning character you want to get and the last is the number of characters count from the beginning.
For example, in the string “I have a dream above”, if I want to get the letter I using MID function, I would write this:
If I want to get “have”, I need to write:
The first character is I, the second is a blank space so h is at position 3.
As you can see, LEFT, RIGHT, MID are very useful functions to extract text from string. I hope this post is helpful to you. Please don’t forget to check my excel add-in to enable autocomplete function in Excel from 2007 to 2016.