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
 
Perhaps a follw-up formula in the next cell that removes any alpha if present?
S DINHOFER MD returns DINHOFER MD
Thank you
 
Last edited:
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
OK - that's me out of ideas, sorry. You've now added criteria for which I cannot find any logic that Excel will understand without having some definitive list to refer to. I think you are going to need to state exactly what is and what is not allowed as a suffix, and give every possible combination of name formats, otherwise we'll just be going round in circles all afternoon! ;)
 
Upvote 0
Allowed suffixes are MD, DO or nothing.
Would it be easier to eliminate suffixes? I can live without the suffixes if that would make this work.
Thank you very much.

Thank you
 
Upvote 0
That's helpful. I'm away from my laptop at present, so maybe someone else will take this up. Are you sure there are no further criteria that need accommodating?
 
Last edited:
Upvote 0
IF you names can be all capitalised like your samples in post #7 then I'm with Joe. I don't think this is possible.
Certainly you would need to have a complete list of possible suffixes to even get close.
However, even then it would not be possible to be sure. Another example. Suppose "PO" is an allowable suffix and a cell contains "PAUL KEENE PO"
That could mean "PAUL KEENE" (no MI) with suffix "PO"
or it could mean "PAUL PO" whose middle name is "KEENE".

However, IF all the names are standard Upper/Lower case and the suffix is all upper case, then the problem is solvable as the two examples I gave above would be different & therefore distinguishable.
The first would be: "Paul Keene PO"
The second would be: "Paul Keene Po"
 
Upvote 0
My apologies, I should be more clear.
All data will be capitalized.
The only possible suffixes are MD DO (no suffix)

Thank you
 
Upvote 0
The only possible suffixes are MD DO (no suffix)
So no "RN" suffixes like some of your earlier examples? Then assuming "DO" will never be a LN (pretty resonable assumption :)), then would this suffice, depending on whether you want LN + SUFFIX or just LN


Excel 2010 32 bit
ABC
1ANTHONY BURGOS MDBURGOS MDBURGOS
2BENJAMIN W STRONG MDSTRONG MDSTRONG
3DAVINDRA SEELAGAN MDSEELAGAN MDSEELAGAN
4DEREK J PLAKYDA MDPLAKYDA MDPLAKYDA
5EDWARD CALLAWAY MDCALLAWAY MDCALLAWAY
6JOHN H MORE DOMORE DOMORE
7JOHN H MOREMOREMORE
8DEREK J PLAKYDAPLAKYDAPLAKYDA
9KEN JONESJONESJONES
Names
Cell Formulas
RangeFormula
B1=TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",50)),50+50*OR(RIGHT(A1,3)={" MD"," DO"})))
C1=TRIM(RIGHT(SUBSTITUTE(LEFT(A1,LEN(A1)-3*OR(RIGHT(A1,3)={" MD"," DO"}))," ",REPT(" ",500)),50))



You would still have the problem mentioned by Joe though:
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)
 
Upvote 0
Perfect.
Thank you Peter, AliGW, & Joe.

This will meet 99% of the scenarios. two-part last names or other suffixes will/can be manually corrected.

All the best, Jason
 
Upvote 0

Forum statistics

Threads
1,215,012
Messages
6,122,682
Members
449,091
Latest member
peppernaut

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