ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sorting names in a range (https://www.excelbanter.com/excel-worksheet-functions/20389-sorting-names-range.html)

John S

Sorting names in a range
 
Just wondering if this is possible...
I have a range for names a1 - a10
I want to put name in the cells "firstname lastname"
Is there a way to have the names put in the way specified and be able to
sort them from the last name?
Is there a way to check a string to a space?
With the variable of the first name being different lengths, can you use the
space after the first name as the marker to choose the next letter (the first
letter of the last name) and use this to sort the names in the range?
Or am I way off base and there might be an easier way.

Thanks for any help.

John

Ragdyer

One way is to add a "helper" column, where a text formula will extract the
last name, and you then sort the 2 columns, using the "helper" as the sort
key.

This will work for 2 names, or in reality, the text after the first space in
the string:

=MID(A1,FIND(" ",A1)+1,50)
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"John S" <John wrote in message
...
Just wondering if this is possible...
I have a range for names a1 - a10
I want to put name in the cells "firstname lastname"
Is there a way to have the names put in the way specified and be able to
sort them from the last name?
Is there a way to check a string to a space?
With the variable of the first name being different lengths, can you use

the
space after the first name as the marker to choose the next letter (the

first
letter of the last name) and use this to sort the names in the range?
Or am I way off base and there might be an easier way.

Thanks for any help.

John



Arvi Laanemets

Hi

Such tasks are stong arguments to have all parts of name - firstname(s),
lastname(s), title etc. in separate columns. You can always generate full
name in any configuration from separate columns with a single formula, but
there doesn't exist a general reversive solution. Sometimes people have a
lot of first names, sometimes several last names, some people have a title
(Von, Van, Don etc.) as apart of their name and some don't - so when you use
formula like Ragdyer's one, you always have to check the result, and
probably you have to edit the list manually.

You can enter the full name in single cell only then, when you are
absolutely sure you never have to use any part of it separately.

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"John S" <John wrote in message
...
Just wondering if this is possible...
I have a range for names a1 - a10
I want to put name in the cells "firstname lastname"
Is there a way to have the names put in the way specified and be able to
sort them from the last name?
Is there a way to check a string to a space?
With the variable of the first name being different lengths, can you use

the
space after the first name as the marker to choose the next letter (the

first
letter of the last name) and use this to sort the names in the range?
Or am I way off base and there might be an easier way.

Thanks for any help.

John





All times are GMT +1. The time now is 10:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com