Solved

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

Posted on 2013-12-04
3
254 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now