Last Name, First Name, MI

Wulf

Active Member
Joined
Dec 1, 2004
Messages
395
Office Version
  1. 365
Platform
  1. Windows
There are several SIMILAR threads, but I couldn't find one that fit this:

I need to turn "Last Name, First Name MI" in cell I9 on Sheet1 into:

"Last Name" in E9, "First Name" in R9, and "MI" in AF9 on Sheet1.5, with it also showing "" (blank) in AF9 if there is no "MI" in I9 on Sheet1.

I've been able to extract the last name, and even the first name....but if that's all there is, then it puts the last letter of the first name as the middle initial, and if there is a middle initial, that cell goes blank.

????

Thanks!
 
Last edited:
Better yet,

Change the AF9 formula to:

=IF(LEN(TRIM(RIGHT(SUBSTITUTE(I9,".",""),2)))=1,TRIM(SUBSTITUTE(RIGHT(I9,2),".","")),"")
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Is there any way to create a macro for something similar to the above?

I have the following format

First Name MI Last Name in Column A.

Sometimes there is a space on the last name for someone with a last name Mc Cormick (for example)

Also, sometimes the list of names is short and sometimes the list of names is long. Is there a way to get a "universal" macro in place, that will not depend on the number of names in the list but will be able to detect when the list ends?

So far I was able to run the macro to get them from text-to-column into cells A, B, and C. However, the middle column sometimes contains the last name if there isn't a middle initial. I need a way to test the middle column for more than one character. If there is more than one character, it is a last name and needs to be in the third column.
Thank you so much for your help!
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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