How to pull Certain Text/Names from a Data String

Adroit

New Member
Joined
Jul 16, 2012
Messages
16
Hello,

I was given great assistance on another excel problem I had so I was hoping I'd be able to get additional help on another one.

With the provided data set below, how would I be able to pull out only the names? Note that I substituted "X" for portions of the names as this is actual data. Thanks.
NDM Abxx, Kexxxxx 100118416 2-29-12.pdf</SPAN>
VPG I9 Aberxxxxx, Dexxx 100113048 1-1-12.pdf</SPAN>
I-9 Abxxx, Rexx 100119966 4-5-12.pdf</SPAN>
NDM I9 Achxxxn, Paxx 100119008 3-15-2012.pdf</SPAN>
VPG I-9 Acxxxxx, Toxx 100112782 01-01-12.pdf</SPAN>
I-9 Acxxxr, Gxxx 100117854 2-27-12.pdf</SPAN>
NDM Acxxx, Angxxxxx 1001118015 3.3.12.pdf</SPAN>
ADXXX, DEXXX 100118892 I9.pdf</SPAN>
I-9 Adxxx, Chxxxxxxx 100119633 3-28-12.pdf</SPAN>
I-9 Adxxxx, Daxxx 800011320 6-14-12.pdf</SPAN>
I-9 Adxxxx,Jenxxxx 100121079 5 25 2012.pdf</SPAN>
VPG I9 Axxxx, Lxxxx E 100113621 1-1-12.pdf</SPAN>
NDM I9 Adaxx, Mxxx 100117676 2-16-2012.pdf</SPAN>
NDM I9 Adxxxx, Pxxx100117778 2-18-2012.pdf</SPAN>
ADXXX, PXXX T 100117778.pdf</SPAN>

<TBODY>
</TBODY>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi. Your data is not entirely consisent so no solution will be perfect. I put together this. It identified that the second last line the name runs into the number without a space. I also realised that some names have what might be an initial, or might be part of the other data. This solution excludes it. If you ever have more than 2 spaces before the name then this will return an incorrect result. You should be able to modify the IF to allow for it necessary.
IF(LEN(LEFT(A2,FIND(",",A2)))-LEN(SUBSTITUTE(LEFT(A2,FIND(",",A2))," ",""))=1,MID(A2,FIND(" ",A2),FIND(" ",A2,FIND(",",A2)+2)-FIND(" ",A2)),MID(A2,FIND(" ",A2,FIND(" ",A2)+1),FIND(" ",A2,FIND(",",A2)+2)-FIND(" ",A2,FIND(" ",A2)+1)))
I expect this can be simplified.
 
Upvote 0

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

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