Parse Last Name, exclude MI, keep suffix

skyhigh_ct

New Member
Joined
Jul 14, 2007
Messages
29
Hello. I have researched & read numerous posts.
Still searching for formula to parse last name, exclude middle initial & keep any suffixes.

John Doe MD > Doe MD
Jane Doe RN > Doe RN
John H Doe DO > Doe DO
John Doe > Doe
John H Doe Jr MD > Doe Jr MD

Thank you
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
How do you envisage that Excel will distinguish between a text string that is a first name and one that is a second name? Is the first name always the first in the string? In other words, do you have any in the format Doe DO John?
 
Upvote 0
For this purpose, the data will always be in the same format. FN MI (if applicable) LN suffix
Thank you.
 
Upvote 0
I guess I should have been more specific. The last names will not always be Doe.

John Doe MD > Doe MD
Jane may RN > May RN
John H More DO > More DO
John Deere > Deere
John H Done Jr MD > Done Jr MD
 
Last edited:
Upvote 0
This works on your sample data:

=IF(H1<3,RIGHT(F1,LEN(F1)-FIND(" ",F1)),RIGHT(F1,LEN(F1)-FIND(" ",F1,FIND(" ",F1)+1)))
 
Upvote 0
So close. Thank you AliGW.

For names without middle initials, it is returning just the suffix.
ANTHONY BURGOS MD > MD (look to return BURGOS MD)
BENJAMIN W STRONG MD > STRONG MD
DAVINDRA SEELAGAN MD > MD (look to return SEELAGAN MD)
DEREK J PLAKYDA MD > PLAKYDA MD
EDWARD CALLAWAY MD > MD (look to return CALLAWAY MD)

Thank you
 
Last edited:
Upvote 0
Sorry - incomplete formula given! Should be this:

=IF((LEN(A1)-LEN(SUBSTITUTE(A1," ",""))-1)<3,RIGHT(A1,LEN(A1)-FIND(" ",A1)),RIGHT(A1,LEN(A1)-FIND(" ",A1,FIND(" ",A1)+1)))
 
Upvote 0
I have seen this many times before. Note that it is very unlikely that you can come up with a formula to handle all cases correctly.

For example, what if you had these two names:
Mary Jo Smith
Lucy Van Pelt


Both have three words, but in the first one, the first name is two words (Mary Jo) and the last name is one word (Smith)
In the second one, the first name is one word (Lucy) and the last name is two words (Van Pelt)

There is no way Excel is going to be able to determine exactly where the split should occur in examples like this, since there is no "hard-and-fast" rule you can come up with to program to.

The best you can usually do is to program to handle the most common situations, but it is still going to require someone to review them afterwards to look for exceptions that do not follow the rules you have programmed.
 
Last edited:
Upvote 0
Almost.
Names with MI are retuning with MIs. I am looking to not show MIs. Thank you again. I really appreciate it.

Original Data Returned
DAVID S DINHOFER MD > S DINHOFER MD (looking to not show MI)
DAVINDRA SEELAGAN MD > SEELAGAN MD (perfect)
DEREK J PLAKYDA MD > J PLAKYDA MD (looking to not show MI)
DONALD S OSTRUM MD > S OSTRUM MD (looking to not show MI)
EDWARD CALLAWAY MD > CALLAWAY MD (perfect)
 
Upvote 0

Forum statistics

Threads
1,215,494
Messages
6,125,139
Members
449,207
Latest member
VictorSiwiide

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top