Removing Middle Initial or Middle Name

Mschweider

New Member
Joined
Mar 2, 2015
Messages
12
I have a document where the name format is Last, First Middle Name/Initial. (Sometimes there is a period at the end of the middle initial, sometimes there is not, see below).

I was wondering if it was possible to remove the Middle name/initial using macros. I have found some help but there always seems to be something wrong in at least one case. The list of names is 1533 so I would like it to work without any input from me.

Some example name formats:
Smith, John
Smith, John L
Smith, John L.
Smith Dean, John (Smith Dean is two last names)
Smith Dean, John L
Smith Dean, John L.

I would like it to work with all of those difference since that is how the file comes to me, if possible.

This is the current formula I have found but it doesn't work with two last names:

=IF(LEN(A3)-LEN(SUBSTITUTE(A3," ",""))=1,A3,SUBSTITUTE(LEFT(A3,FIND("^^",SUBSTITUTE(A3," ","^^",2))-1),",","",2))

Thanks for any help!
 
The above solutions work quite nicely in the given context. However, I wonder if anyone has a solution that would work if some of the entries contain multiple first names (for example, "Smith, Ane Margot"). Unfortunately, the solutions above don't distinguish between the single letter of a middle initial and a longer string.
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
The above solutions work quite nicely in the given context. However, I wonder if anyone has a solution that would work if some of the entries contain multiple first names (for example, "Smith, Ane Margot"). Unfortunately, the solutions above don't distinguish between the single letter of a middle initial and a longer string.

Can you show us a few representative example names (and the rearrangements you want for them) that none of the above solutions work for?
 
Upvote 0
Sure. Here is an example list that roughly shows the variety of entries I'm dealing with:

McGee, Bill
Van Dusen, Carl M
Jankowski, Phillip R
Corbett, Karen Ann
Frary, Mary Jane
Manire, Charles L
Hyun, Soo Kyu Wan Lee

My goal is to trim the middle (trailing) initial, if it exists. I've been searching for solutions for a while, but just can't seem to find anything that selectively eliminates single initials while sparing second, third, and fourth first-names. Ultimately, the names will be divided into two columns (last name, first name), but it seems to me that the first step is removing that middle initial.

Thank you for your help.

PS. In the end, the list should look like this:

McGee, Bill
Van Dusen, Carl
Jankowski, Phillip
Corbett, Karen Ann
Frary, Mary Jane
Manire, Charles
Hyun, Soo Kyu Wan Lee
 
Upvote 0
Does it (formula #14) work for "Manire, Charles L." ?
It worked for all cases.
Actually, István has a good point. I missed that some of your middle initials have periods after them... the formula I posted earlier will not work correctly for them (I am not sure why you are saying it does); however, this formula will...

=IF(MID(A1,LEN(A1)-1-(RIGHT(A1)="."),1)=" ",TRIM(LEFT(A1,LEN(A1)-2)),A1)
 
Upvote 0
Another version:

=IFERROR(REPLACE(A1,SEARCH(" ?.",A1&"."),4,""),A1)
If the OP's list had this author's name, or names similarly constructed like it, then your formula would return an incorrect result...

Rowling, J. K.

Also, as written, your formula cannot be copied down past the end of existing data in anticipation for the future addition of more names as it returns a #VALUE! error if the cell is empty.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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