Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 80
Default How to sort a list with Mr, Mrs, Miss ?

Hi
I have a list of names in a spreadsheet that includes Titles, Names &
addresses

Name Address Town Postcode
Mr A Burns 24 Hill street town postcode
Mrs B Mitchel 45 Acreback road town postcode
Miss G Hay The sheddings town postcode
etc etc etc etc

How do I sort this list by surname?
It keeps sorting by Miss, Mr, Mrs
--
Martin
©¿©¬
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 320
Default How to sort a list with Mr, Mrs, Miss ?

If it's consistently title, initial, surname, or title, first name, surname,
then you can select the column, use Data/Text-to-columns using a delimiter
of space and when done sort on the 3rd column.
Bob Umlas
Excel MVP

<Martin ©¿©¬ @nohere.net wrote in message
...
Hi
I have a list of names in a spreadsheet that includes Titles, Names &
addresses

Name Address Town Postcode
Mr A Burns 24 Hill street town postcode
Mrs B Mitchel 45 Acreback road town postcode
Miss G Hay The sheddings town postcode
etc etc etc etc

How do I sort this list by surname?
It keeps sorting by Miss, Mr, Mrs
--
Martin
©¿©¬



  #3   Report Post  
Posted to microsoft.public.excel.misc
JB JB is offline
external usenet poster
 
Posts: 115
Default How to sort a list with Mr, Mrs, Miss ?

With VBA:

http://cjoint.com/?dDtICJNMLz

Sub Sort()
Set First = Range("a1")
ncol = First.CurrentRegion.Columns.Count
nlig = First.CurrentRegion.Rows.Count - 1
First.Offset(0, ncol).EntireColumn.Insert Shift:=xlToRight
For Each c In First.Offset(1, 0).Resize(nlig, 1)
c.Offset(0, ncol) = WithOutCivil(c.Value)
Next c
First.CurrentRegion.Sort Key1:=First.Offset(1, ncol),
Order1:=xlAscending, Header:=xlGuess
First.Offset(0, ncol).EntireColumn.Delete
End Sub

Function WithOutCivil(chaine)
civilite = Array("Mr", "Miss", "Mrs")
WithOutCivil = chaine
p = InStr(chaine, " ")
If p < 0 Then
If Not IsError(Application.Match(UCase(Left(chaine, p - 1)),
civilite, 0)) Then
WithOutCivil = Mid(chaine, p + 1)
End If
End If
End Function

JB
http://boisgontierjacques.free.fr



On 27 mar, 17:48, Martin ©¿©¬ @nohere.net wrote:
Hi
I have a list of names in a spreadsheet that includes Titles, Names &
addresses

Name * * * * * *Address * * * * Town * *Postcode
Mr A Burns * * *24 Hill street * * * * *town * *postcode
Mrs B Mitchel * 45 Acreback road * * * *town * *postcode
Miss G Hay * * *The sheddings * * * * * town * *postcode
etc * * * * * * etc * * * * * * * * * * etc * * etc

How do I sort this list by surname?
It keeps sorting by Miss, Mr, Mrs
--
Martin
©¿©¬


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default How to sort a list with Mr, Mrs, Miss ?

Hi,

And for a third approach you can use a formula. Assuming your first name
starts in A2 then enter the following formula in an adjactent column and sort
on this new column:

=MID(A2,FIND(" ",A2,FIND(" ",A2)+1)+1,9)

If the surnames are longer than 9 characters just increase the last argument.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Martin ©¿©¬ @nohere.net" wrote:

Hi
I have a list of names in a spreadsheet that includes Titles, Names &
addresses

Name Address Town Postcode
Mr A Burns 24 Hill street town postcode
Mrs B Mitchel 45 Acreback road town postcode
Miss G Hay The sheddings town postcode
etc etc etc etc

How do I sort this list by surname?
It keeps sorting by Miss, Mr, Mrs
--
Martin
©¿©¬

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 80
Default How to sort a list with Mr, Mrs, Miss ?

On Fri, 27 Mar 2009 13:05:14 -0400, "Bob Umlas"
wrote:

If it's consistently title, initial, surname, or title, first name, surname,
then you can select the column, use Data/Text-to-columns using a delimiter
of space and when done sort on the 3rd column.
Bob Umlas
Excel MVP


Thanks Bob
that worked well & I was able to make address labels too
--
Martin
©¿©¬

<Martin ©¿©¬ @nohere.net wrote in message
.. .
Hi
I have a list of names in a spreadsheet that includes Titles, Names &
addresses

Name Address Town Postcode
Mr A Burns 24 Hill street town postcode
Mrs B Mitchel 45 Acreback road town postcode
Miss G Hay The sheddings town postcode
etc etc etc etc

How do I sort this list by surname?
It keeps sorting by Miss, Mr, Mrs
--
Martin
©¿©¬




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 80
Default How to sort a list with Mr, Mrs, Miss ?

On Fri, 27 Mar 2009 16:05:01 -0700, Shane Devenshire
wrote:

Hi,

And for a third approach you can use a formula. Assuming your first name
starts in A2 then enter the following formula in an adjactent column and sort
on this new column:

=MID(A2,FIND(" ",A2,FIND(" ",A2)+1)+1,9)

If the surnames are longer than 9 characters just increase the last argument.


Thanks Shane
I'll try that too
--
Martin
©¿©¬
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
Autofill to Last Row but Miss Some Rows? Dave Excel Discussion (Misc queries) 1 July 29th 08 02:13 PM
Excel User Conference - Don't miss out! Damon Longworth Excel Discussion (Misc queries) 0 February 9th 06 12:57 PM
Excel User Conference - Don't miss out! Damon Longworth Excel Discussion (Misc queries) 0 February 9th 06 12:57 PM
Excel sort by Fill Color by custom list sort Dash4Cash Excel Discussion (Misc queries) 2 July 29th 05 10:45 PM
Miss-wrote previous "IF" problem gbeard Excel Worksheet Functions 3 April 14th 05 11:27 PM


All times are GMT +1. The time now is 02:05 PM.

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"