Oct 9 2009

How Do I Get Just the Last Word from a Cell?

This is an example of a question I recently received in the comment section of a post that I think others will find useful.

[ad#in-post-ad]

So the following question was asked in a post’s comment section:

For example, we have the string “Let’s play a game”.

Is there a fomula out there that would be able to tell me that the last work in that string is “game”? HOW! Please share because this question is driving me nuts!

It was interesting, because just the other day another reader had posted a suggestion on a solution this exact problem.  After a slight modification to the formula, we came up with the following formula to solve this issue.

So to get the last word from a string of words in a cell separated by spaces, try this formula:

=IF(ISERROR(FIND(” “,A1)),A1,TRIM(RIGHT(A1,LEN(A1)-FIND(“*”,SUBSTITUTE(A1,” “,”*”,LEN(A1)-LEN(SUBSTITUTE(A1,” “,””)))))))

Random Posts

Did you find this post helpful? Try signing up for our free daily tips.

Enter your email address: 

          
TAGS:

Comments are closed.

Sign Up for Excel Hints

Free updates with Excel Hints, Tips & Tricks

Categories

Archives