#1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 30
Default Sorting

I have a long list of people extracted from a database. Some of the names are
in the format of "John Smith" or "Jane Smith" on different lines, but some of
them are "John and Jane Smith."

How can I sort my list so that I can group all of the cells that contain the
word "and" in it?
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 964
Default Sorting

Use a helper column.

Insert a new column next to your data. For this example, I'll assume your
data is in column A and the helper column is column B. Type this formula
into the cell in the helper column next to your first name in column A.

=IF(ISNUMBER(SEARCH(" and ",A1)),2,1)

Copy this formula down to each cell in your helper column for each name in
column A. Then, when you sort, sort by Column B first, then by Column A.

HTH,
Elkar

"dleo" wrote:

I have a long list of people extracted from a database. Some of the names are
in the format of "John Smith" or "Jane Smith" on different lines, but some of
them are "John and Jane Smith."

How can I sort my list so that I can group all of the cells that contain the
word "and" in it?

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 30
Default Sorting


Works perfectly. Thanks!

"Elkar" wrote:

Use a helper column.

Insert a new column next to your data. For this example, I'll assume your
data is in column A and the helper column is column B. Type this formula
into the cell in the helper column next to your first name in column A.

=IF(ISNUMBER(SEARCH(" and ",A1)),2,1)

Copy this formula down to each cell in your helper column for each name in
column A. Then, when you sort, sort by Column B first, then by Column A.

HTH,
Elkar

"dleo" wrote:

I have a long list of people extracted from a database. Some of the names are
in the format of "John Smith" or "Jane Smith" on different lines, but some of
them are "John and Jane Smith."

How can I sort my list so that I can group all of the cells that contain the
word "and" in it?

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
Automatic sorting (giving max and min) based on custom sorting lis Joe Lewis[_2_] Excel Worksheet Functions 4 November 23rd 08 05:12 AM
Sorting reedsm Excel Discussion (Misc queries) 0 September 23rd 08 01:58 PM
Sorting VLookup vs Sorting SumProduct Lauren Excel Discussion (Misc queries) 1 August 21st 07 12:19 AM
Sorting: Sorting by the First Character dzuy Excel Discussion (Misc queries) 2 June 22nd 06 08:27 PM
sorting Patrick Excel Discussion (Misc queries) 1 July 20th 05 02:15 PM


All times are GMT +1. The time now is 12:42 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"