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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Oaktree

MrExcel MVP
Joined
Jun 20, 2002
Messages
8,021
Office Version
  1. 365
=LEFT(A1,SEARCH(",",A1)-1)

Edit: Looks like Smitty beat me to it :)
 

clipro

Board Regular
Joined
Jan 12, 2005
Messages
195

ADVERTISEMENT

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?
 

Carvel

Board Regular
Joined
Apr 27, 2004
Messages
180
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
 

Gcheris

New Member
Joined
Mar 23, 2005
Messages
1
:eek: On the above formulas, the colons need to be replaced by commas - at least in Excel 2000.
 

Forum statistics

Threads
1,147,681
Messages
5,742,587
Members
423,739
Latest member
plkdti

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
Top