ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Alternating sort question (https://www.excelbanter.com/excel-worksheet-functions/185294-alternating-sort-question.html)

GaryM

Alternating sort question
 
My wife is working on a spreadsheet for a class roster and one column
specifies gender (M,F). She would like to sort the students by alternating M
& F instead of all M and then all F to assign a seating chart. Is this
possible? Thanks in advance!

GaryM

Pete_UK

Alternating sort question
 
Perhaps you could sort by gender first to get all the F's together
then all the M's. Then fill a sequence down a helper column 1, 2, 3
etc for just the females. Fill a new sequence 1, 2, 3 etc down the
column for just the males. Then you can sort the data plus the helper
column using the helper sequence as the sort key (plus gender as the
second key), and then you will get the sequence 1_F, 1_M, 2_F, 2_M,
3_F, 3_M etc. You can delete the helper column then.

Obviously, if you have more of one gender then these will all appear
together at the end.

Hope this helps.

Pete

On Apr 27, 8:17*pm, GaryM wrote:
My wife is working on a spreadsheet for a class roster and one column
specifies gender (M,F). *She would like to sort the students by alternating M
& F instead of all M and then all F to assign a seating chart. *Is this
possible? *Thanks in advance!

GaryM



Jim Cone[_2_]

Alternating sort question
 

Sort the students by gender.
In an adjoining column, consecutively number the male students... say 1 thru 20
and then assign the same numbers to the female students... 1 thru 20.
Select all the data including the new column and sort using the new column as the key.
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"GaryM"
wrote in message
My wife is working on a spreadsheet for a class roster and one column
specifies gender (M,F). She would like to sort the students by alternating M
& F instead of all M and then all F to assign a seating chart. Is this
possible? Thanks in advance!
GaryM

Gord Dibben

Alternating sort question
 
Probably an easier way but here goes my contribution.

DataFilterAutofilter for F on the gender column.

In a helper column enter 1 through whatever using consecutive odd numbers.

Show All then Filter on M and enter 2 through whatever using even numbers.

Remove the Filter and sort by helper column.


Gord Dibben MS Excel MVP

On Sun, 27 Apr 2008 12:17:01 -0700, GaryM
wrote:

My wife is working on a spreadsheet for a class roster and one column
specifies gender (M,F). She would like to sort the students by alternating M
& F instead of all M and then all F to assign a seating chart. Is this
possible? Thanks in advance!

GaryM



Gord Dibben

Alternating sort question
 
I knew there was an easier way<g

Assign same numbers after filtering, not odds and evens.


Gord

On Sun, 27 Apr 2008 12:41:17 -0700, "Jim Cone"
wrote:

In an adjoining column, consecutively number the male students... say 1 thru 20
and then assign the same numbers to the female students... 1 thru 20.



Jim Cone[_2_]

Alternating sort question
 

The most difficult solution is usually the first one to come to mind.
That's the way it works for me. <g
Jim Cone


"Gord Dibben"
wrote in message
I knew there was an easier way<g
Assign same numbers after filtering, not odds and evens.
Gord



On Sun, 27 Apr 2008 12:41:17,
"Jim Cone"
wrote:
In an adjoining column, consecutively number the male students... say 1 thru 20
and then assign the same numbers to the female students... 1 thru 20.




All times are GMT +1. The time now is 02:32 AM.

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