Sorting

C

ccontreras

I have a table with names, every name is in the same cell. How Do I sort by
last name if the default order is left to right? Can I change that Order?
 
S

Sheeloo

Your requirement is not clear...
All names in one cell of Excel or each name in its own cell?
How are the names stored - last name, first name?
Can you sample data?
 
C

ccontreras

I have each name on it's own cell and stored by first name, but I want to
sort them by last name
 
S

Sheeloo

IF you have names in Col A
then enter this in B1
=LEFT(A1,FIND(" ",A1)-1)
and this in C1
=RIGHT(A1,LEN(A1)-FIND(" ",A1))
and copy down till the end of your data in A1...

This will split the name into first and last name separating on space.

You can then sort on Col C...
 
G

Gord Dibben

Split into two columns using Data>Text to Columns delimited by space or
comma.

Select both columns and sort on last name.


Gord Dibben MS Excel MVP
 
S

ShaneDevenshire

Hi,

I second Gord's suggestion - the method of choice is always Text to Columns,
if it does the job.

But if you are going to use formulas you can shorten the second one to read:
=MID(A1,FIND(" ",A1)+1,9)

If the last names are longer than 9 characters, just increase this to 20 or
99 or whatever.

The problem with formulas is that if you need to deal with First, Middle and
Last names it becomes more complicated, while text to columns do not get more
difficult.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top