#1   Report Post  
Caden
 
Posts: n/a
Default Sorting


Hey all.

I have a column with users first name and last name inside the same
single column

What I want to do is split the data, into 2 columns and I can do this.

Problem is, not all the data is the same, for instance

John Doe
Dr John Doe
John Doe III

etc...

Therefore, I am wondering if there is a way to sort the data so the
column will show the fields with FirstName Lastname first and then sort
the exceptions in no parciular order.

Thanks
Caden


--
Caden
------------------------------------------------------------------------
Caden's Profile: http://www.excelforum.com/member.php...o&userid=27252
View this thread: http://www.excelforum.com/showthread...hreadid=467583

  #2   Report Post  
Caden
 
Posts: n/a
Default


I'll try to be more clear

What I want, is for excel to sort based on 2 words...so, if the field
has 2 words, I want that at the top, if the field has more then 2 words
I want that at the bottom...in no particular order, just simply by 2
words

Edit: I can go into the options and set a custom list, all i'm looking
for is the formula to tell excel sort by A B, A B C, A B C D
etc

And the A and B are variables, they can be anything


--
Caden
------------------------------------------------------------------------
Caden's Profile: http://www.excelforum.com/member.php...o&userid=27252
View this thread: http://www.excelforum.com/showthread...hreadid=467583

  #3   Report Post  
B. R.Ramachandran
 
Posts: n/a
Default

Hi,

There may be more elegant approaches. But the following formula could do it.

First create a list of prefixes that are likely to occur in the names in a
separate helper column. Here, I made such a list in F2:F11 (Mr, Mrs, Miss,
Ms, Dr, Mr., Mrs., Miss., Ms., Dr.). I am assuming that the names are in
Column A, starting at A2. The formula goes in B2, and then fill-down the
column.

=IF(ISNUMBER(MATCH(LEFT(A2,FIND(" ",A2)-1),$F$2:$F$11,0)),MID(A2,FIND("
",A2)+1,100)&" "&LEFT(A2,FIND(" ",A2)-1),A2)

For the formula to work, there should be space between the prefix and the
first name even when the prefix ends with a period.

Regards,
B. R. Ramachandran

"Caden" wrote:


Hey all.

I have a column with users first name and last name inside the same
single column

What I want to do is split the data, into 2 columns and I can do this.

Problem is, not all the data is the same, for instance

John Doe
Dr John Doe
John Doe III

etc...

Therefore, I am wondering if there is a way to sort the data so the
column will show the fields with FirstName Lastname first and then sort
the exceptions in no parciular order.

Thanks
Caden


--
Caden
------------------------------------------------------------------------
Caden's Profile: http://www.excelforum.com/member.php...o&userid=27252
View this thread: http://www.excelforum.com/showthread...hreadid=467583


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
Maintaining cell reference after sorting GRITS Excel Discussion (Misc queries) 2 April 30th 23 07:42 PM
Advice sought: Multiple column sorting davidm Excel Worksheet Functions 3 July 29th 05 02:06 PM
Sorting 1, 1A, 2, 2A, 3, 4, 4A, 4B . . . agc1234 Excel Discussion (Misc queries) 6 May 26th 05 08:02 PM
sorting number in ascending order Janice Lee via OfficeKB.com Excel Discussion (Misc queries) 2 April 8th 05 10:31 PM
Adding a KeyID column for sorting Rebecca New Users to Excel 3 February 20th 05 07:09 PM


All times are GMT +1. The time now is 03:22 PM.

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

About Us

"It's about Microsoft Excel"