Saturday, September 13, 2014

Extract Part of Strings

There are several ways to extract part strings using formula. In this post I'll explain the use of "Left" & "Right" functions.

If you are wishing to download Excel file which has all examples, including this click here.

Left function gives the few characters in a string. Number of characters to show is based on your selection.
When you start entering "left" function you can see below text on excel

=Left(text,[num_chars])

Understanding above will make easy understanding the output. 

text means the mother string. We can use cell reference or String inside "" marks for this. (See examples below). num_chars denote the Number of characters to display. (Count from left)

Let cell B3 =AppleiPhone
Enter bellow formula to cell C3
=LEFT(B3,2)
The result will be "Ap" (2 characters from the left)

Enter below formula to cell D3
=LEFT("AppleiPhone",2)

See results.

The only difference in Right function is it counts from the right. To understand this enter bellow formula to cell E3
=RIGHT(B3,2)
The result will be "ne" (2 characters from the right)

Enter below formula to cell F3
=RIGHT("AppleiPhone",2)

Featured Post

XLOOKUP in Excel: The Ultimate Guide to Dynamic Data Lookup

Excel is a powerful tool for analyzing data, but sometimes finding specific data points can be a headache-inducing task. That's where XL...