Saturday, December 21, 2013

Excel extarct words before and after a specific word

Excel extarct words before and after a specific word

For example, you have the following text in a cell “A1″ and you’d like to extract the text before the comma (the last name):
“Alam, Afroz”
To extract the last name before the comma “Alam” from A1, use one of the following formula:
=LEFT(A1,(FIND(",",A1,1)-1))
The result: Alam
To extract the first name after the comma from A1, use one of the following formula:
=MID(A1,FIND(",",A1)+2,256)
The result: Afroz

2 comments: