ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Sorting a list of names by last name. (https://www.excelbanter.com/excel-discussion-misc-queries/77925-sorting-list-names-last-name.html)

Reb

Sorting a list of names by last name.
 
Using Win XP, Excel 2003. All updates installed.

Unfortunately the full name is contained in one cell. for example, Cell A1
contains: John P. Jones. The worksheet cannot be changed so setting up
separate columns is not an option. Is there any way to sort the column by
last name?

Nick Hodge

Sorting a list of names by last name.
 
Reb

You cannot sort by certain characters in a string via the UI. You will need
to seperate the last name into another column

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"Reb" wrote in message
...
Using Win XP, Excel 2003. All updates installed.

Unfortunately the full name is contained in one cell. for example, Cell A1
contains: John P. Jones. The worksheet cannot be changed so setting up
separate columns is not an option. Is there any way to sort the column by
last name?




Ron Rosenfeld

Sorting a list of names by last name.
 
On Thu, 16 Mar 2006 20:40:19 -0800, Reb wrote:

Using Win XP, Excel 2003. All updates installed.

Unfortunately the full name is contained in one cell. for example, Cell A1
contains: John P. Jones. The worksheet cannot be changed so setting up
separate columns is not an option. Is there any way to sort the column by
last name?


You will need to set up a helper column that contains only the last name; then
use that helper column as the sort key. You can subsequently delete or hide
the helper column.


--ron

Ron Rosenfeld

Sorting a list of names by last name.
 
On Thu, 16 Mar 2006 20:40:19 -0800, Reb wrote:

Using Win XP, Excel 2003. All updates installed.

Unfortunately the full name is contained in one cell. for example, Cell A1
contains: John P. Jones. The worksheet cannot be changed so setting up
separate columns is not an option. Is there any way to sort the column by
last name?



To extract just the last name, assuming they are in the above format, you can
use a formula like:

=MID(" "&A1,FIND(CHAR(1),SUBSTITUTE(" "&A1," ",CHAR(1),
LEN(" "&A1)-LEN(SUBSTITUTE(" "&A1," ",""))))+1,255)

This will pick up the last word in the string. By prepending a <space to the
string as I did, it will not give an error message if there is only a single
name in the string -- it will return that name.


--ron


All times are GMT +1. The time now is 07:06 PM.

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