Solved

Removing a name suffix (JR) and a middle name from a text box in Excel 2010

Posted on 2013-12-04
3
291 Views
Last Modified: 2013-12-04
I am currently using the following formula to take names on a spreadsheet from Last, First to First Last:

=PROPER((RIGHT(A2,LEN(A2)-FIND(" ",A2,1)))&" "&(LEFT(A2,FIND(" ",A2,1)-2)))

Recently we've had a few names show up with Jr. or a middle name on the end appearing as such:

Doe JR, John or Doe Middle, John rather than just Doe, John

This causes my formula to go a little bananas.  Rather than use ctrl+H and replace them, I would like to try and make some changes to the above formula to do it all in once pass if possible.  How would I go about making the above formula ignore the third word as they appear in the examples?

Thanks!

-Straws
0
Comment
Question by:StrawsPulledAtRandom
3 Comments
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 39696309
What results do you expect in those two cases?

If you just want John Doe try this formula

=PROPER(MID(A2&" "&A2,FIND(",",A2)+2,LEN(A2)-IFERROR(FIND(" ",A2,FIND(" ",A2)+1)-FIND(" ",A2),1)))

regards, barry
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39696323
Keeping all three you might try

=PROPER((RIGHT(A2,LEN(A2)-FIND(", ",A2,1)-1))&" "&(LEFT(A2,FIND(", ",A2,1)-1)))
0
 

Author Closing Comment

by:StrawsPulledAtRandom
ID: 39696344
This did the trick as requested.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question