Alternating sort question

G

GaryM

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
 
P

Pete_UK

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
 
J

Jim Cone

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
 
G

Gord Dibben

Probably an easier way but here goes my contribution.

Data>Filter>Autofilter 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
 
G

Gord Dibben

I knew there was an easier way<g>

Assign same numbers after filtering, not odds and evens.


Gord
 
J

Jim Cone

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top