How about this nightmare?

MrBurn5

New Member
Joined
Jul 4, 2016
Messages
48
I've been handed a data set with 70,000 entries - that were put together by someone lacking vision and understanding. They put in Column A the employees' entire name - in varying forms - and we need to extract it all. in to new cells for first, middle initial/name, last, suffix.


Below is an example of things we've seen:

Excel 2016 (Mac) 32 bit
D
8Jeff Smith
9Joe G. Smith
10Jerry G. Smith Jr.
11Scott Smith Jr.
12Joe Gerald Smith
13Thomas F. Gerber
14Thomas Jackson
15George M. St. Clair Jr.
16

<colgroup><col style="width: 25pxpx"><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1
I know it's not a lot to go off of, but if anyone has any suggestions on how to start, it would be appreciated.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
@MrBurn5, here's a formula solution, if you'd prefer that to VBA.

Create four columns to the right of the original name column for First, Middle, Last, Suffix. Since your post showed the original names in Column D, I'll assume the aforementioned columns will be in E, F, G and H respectively.

Assuming also that your original names start in cell, enter these formulas into E2, F2, G2 and H2; then select those four formulas and copy-drag them down as far as you need them:

E2:

Code:
=LEFT(D2,FIND(" ",D2)-1)

F2:

Code:
=IF(LEN(D2)-LEN(SUBSTITUTE(D2," ",""))>1,IF(RIGHT(D2,1)=".","",LEFT(SUBSTITUTE(D2,E2&" ",""),FIND(" ",SUBSTITUTE(D2,E2&" ",""))-1)),"")

G2:

Code:
=TRIM(SUBSTITUTE(TRIM(SUBSTITUTE(D2,E2&" "&F2,"")),H2,""))

H2:

Code:
=IF(OR(RIGHT(D2,1)=".",ISNUMBER(FIND(" I ",D2&" ")),ISNUMBER(FIND(" II",D2)),ISNUMBER(FIND(" III",D2)),ISNUMBER(FIND(" IV",D2))),MID(D2,FIND("zzz",SUBSTITUTE(D2," ","zzz",LEN(D2)-LEN(SUBSTITUTE(D2," ","")))),10),"")

You'll need all four formulas in place for the system to work, since they are interdependent.

This solution will cover all scenarios shown in your original post above, as well as a few others (e.g., suffixes such as I, II, III, etc.).
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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