#1   Report Post  
Posted to microsoft.public.excel.misc
Tee
 
Posts: n/a
Default sort names

Please help I have a very long list of names all typed in one cell ie:

Miss L Rayner
Mr J C F Clark
Mr P R Brown
Mr D L P Race
Ms Peal

I need to sort this list by the last name.

I can sort this via Data Text to columns, but this give the surname in
either column 3, 4 or 5... is there anyway to overcome this and sort all
those after the last space?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Stefi
 
Posts: n/a
Default sort names


Assume the names are in column A, with an UDF:

=MID(A1,FindRev(A1," ")+1,255)

Public Function FindRev(StrtoSearch As String, StrSearchedFor As String) As
Long
FindRev = 0
On Error Resume Next
FindRev = InStrRev(StrtoSearch, StrSearchedFor)
End Function

Regards,
Stefi

€˛Tee€¯ ezt Ć*rta:

Please help I have a very long list of names all typed in one cell ie:

Miss L Rayner
Mr J C F Clark
Mr P R Brown
Mr D L P Race
Ms Peal

I need to sort this list by the last name.

I can sort this via Data Text to columns, but this give the surname in
either column 3, 4 or 5... is there anyway to overcome this and sort all
those after the last space?

  #3   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default sort names

Use this formula to get the last name in a separate column

=RIGHT(A1,LEN(A1)-FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1,"
","")))))

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Tee" wrote in message
...
Please help I have a very long list of names all typed in one cell ie:

Miss L Rayner
Mr J C F Clark
Mr P R Brown
Mr D L P Race
Ms Peal

I need to sort this list by the last name.

I can sort this via Data Text to columns, but this give the surname in
either column 3, 4 or 5... is there anyway to overcome this and sort all
those after the last space?



  #4   Report Post  
Posted to microsoft.public.excel.misc
Jef Gorbach
 
Posts: n/a
Default sort names

select the name column then \Data\Text to Columns delimited by space to
blank columns (splits into the various parts) then Data\Sort on last name.
Remove the no-longer needed columns, but might consider keeping the last
name as a hidden column for future resorting.

"Tee" wrote in message
...
Please help I have a very long list of names all typed in one cell ie:

Miss L Rayner
Mr J C F Clark
Mr P R Brown
Mr D L P Race
Ms Peal

I need to sort this list by the last name.

I can sort this via Data Text to columns, but this give the surname in
either column 3, 4 or 5... is there anyway to overcome this and sort all
those after the last space?



  #5   Report Post  
Posted to microsoft.public.excel.misc
Stefi
 
Posts: n/a
Default sort names

Tricky, I like it! But Microsoft should make things easier by introducing VB
InStrRev as a worksheet function!

Regards,
Stefi


€˛Bob Phillips€¯ ezt Ć*rta:

Use this formula to get the last name in a separate column

=RIGHT(A1,LEN(A1)-FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1,"
","")))))

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Tee" wrote in message
...
Please help I have a very long list of names all typed in one cell ie:

Miss L Rayner
Mr J C F Clark
Mr P R Brown
Mr D L P Race
Ms Peal

I need to sort this list by the last name.

I can sort this via Data Text to columns, but this give the surname in
either column 3, 4 or 5... is there anyway to overcome this and sort all
those after the last space?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort names and e-mails from one column jul3s Excel Discussion (Misc queries) 4 December 9th 05 03:41 PM
How do I sort entire spread sheet. Names w/data rstampa Excel Worksheet Functions 4 September 13th 05 03:10 AM
Formula to sort names in alphabetical order? Fredrik Jonsson Excel Discussion (Misc queries) 0 September 1st 05 04:33 PM
I have 32k names & addr to sort, I'm scared to do it PeterM Excel Discussion (Misc queries) 2 July 10th 05 10:24 PM
how to sort names and social security numbers a to z olajune1 Excel Worksheet Functions 2 February 25th 05 12:31 PM


All times are GMT +1. The time now is 09:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"