Last Name, First Name

sstorm

Board Regular
Joined
Nov 5, 2003
Messages
76
I want to pull out only the last name. I can't use a MID function because the last names are all different lengths. What is the best way to do this?


Doe, John I want it to tell me Doe
Deer, Jon I want it to tell me Deer
Andres, Mark I want it to tell me Andres

Thanks for all your help!!

Stacy
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
=LEFT(A1,SEARCH(",",A1)-1)

Edit: Looks like Smitty beat me to it :)
 
Upvote 0
I suppose that there is a space " " between the first and the second name so if everything is in one column youcan use formula

=RIGHT(A2;LEN(A2)-FIND(" ";A2))

so as result in the second column you will have only the last name

BTW I presume that the last name is typed after the first name as John SMITH not as SMITH John

but if you have got the second case use this

=LEFT(A1;FIND(" ";A1))

is it good enough?
 
Upvote 0
Hi SStorm,

You could also try selecting the column with the names, and clicking Data/Text to Columns/Delimited/(select Comma and Space)/Finish

This will split your data into two columns, with first and last names in each column. One warning: if there is data in the column just to the left of your names, it will be over-written. Insert an additional column if this is the case.

Hope this helps!

- Kevin
 
Upvote 0

Forum statistics

Threads
1,213,563
Messages
6,114,332
Members
448,566
Latest member
Nickdozaj

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