Background
Excel is well suited for textual data extraction. As the words natural meaning suggest, LEFT function extracts specified characters from left and RIGHT function from right.
Syntax
=LEFT(source_text,how_many)
1
2
=RIGHT(source_text,how_many)
1
2
source_text
Text / Cell address which contains the text
how_many
Number of characters to extract from that text
Text / Cell address which contains the text
how_many
Number of characters to extract from that text
Example
Say we want to extract First Name from text Salman Salim Khan
1 | 2 | 3 | 4 | 5 | 6 | |||||||||||
S | a | l | m | a | n | S | a | l | i | m | K | h | a | n |
So, we need to extract 6 characters from left. So our function would be (as shown below)
Now we want to extract Surname from text Salman Salim Khan
4 | 3 | 2 | 1 | |||||||||||||
S | a | l | m | a | n | S | a | l | i | m | K | h | a | n |
For extracting Surname, we nees 4 characters from right. So our expression would be
Note
- Space will also be counted as character
- Even if extracted text is number, still it gets converted into text
- On omitting how_many it is treated as 1 resulting to extraction of first (LEFT) / last (RIGHT) character
- Writing negative number in how_many does not reverse functionality of respective functions. It will display error