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
Jeff Smith
Joe G. Smith
Jerry G. Smith Jr.
Scott Smith Jr.
Joe Gerald Smith
Thomas F. Gerber
Thomas Jackson
George M. St. Clair Jr.

<colgroup><col style="width: 25pxpx"><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]8[/TD]

[TD="align: center"]9[/TD]

[TD="align: center"]10[/TD]

[TD="align: center"]11[/TD]

[TD="align: center"]12[/TD]

[TD="align: center"]13[/TD]

[TD="align: center"]14[/TD]

[TD="align: center"]15[/TD]

[TD="align: center"]16[/TD]
[TD="align: right"][/TD]

</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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
@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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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