Extracting a middle word in cell without space separation

sergiopcrt

New Member
Joined
May 12, 2017
Messages
12
Hello everyone,

I need to extract the FirstName from cells in a particular format LastName,FirstName MiddleName1 MiddleName2
Note that LastName,FirstName has no space in between, only the comma so I adapted a formula I found on google to:
=MID(A10,SEARCH(",",A10,1)+1,SEARCH(" ",A10,SEARCH(" ",A10,1)+1)-SEARCH(",",A10,1))

but it is still returning FirstName MiddleName1 and other variations return FirstName Mi

From my google searches and in this forum I got no results. Can you help me on this?

Season's greetings!
 

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
If you wanted this one can be dragged right and will produce all the names in order:

=TRIM(MID(SUBSTITUTE(SUBSTITUTE($A1,","," ")," ",REPT(" ",LEN($A1))),(COLUMNS($A$1:A1)-1)*LEN($A1)+1,LEN($A1)))
 
Upvote 0
If you wanted this one can be dragged right and will produce all the names in order:

=TRIM(MID(SUBSTITUTE(SUBSTITUTE($A1,","," ")," ",REPT(" ",LEN($A1))),(COLUMNS($A$1:A1)-1)*LEN($A1)+1,LEN($A1)))
Also very useful, this is like the gourmet version of the previous one :)
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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