Sorting problems

M

mr_teacher

Hi all,

Hoping that this will make some sense!!

I have a range of data that has a formula in the seventh column that
will produce a result of 1,2, or 3

What I need to do is sort all data based on this result.

Firstly I need to sort by this column.

Secondly, if the result is 1 then I want to sort data with this result
by surname (Column 2) and then first name (Column 1)

Thirdly, if the result is 2 then I want to sort by reference number
which is in column eight

I could work out how to do the seperate sorts ok, but I can't work out
how to do the multiple criteria sorts. Any ideas at all that might
help?

Thanks a lot

Regards

Carl
 
L

Lars-Åke Aspelin

Hi all,

Hoping that this will make some sense!!

I have a range of data that has a formula in t rhe seventh column that
will produce a result of 1,2, or 3

What I need to do is sort all data based on this result.

Firstly I need to sort by this column.

Secondly, if the result is 1 then I want to sort data with this result
by surname (Column 2) and then first name (Column 1)

Thirdly, if the result is 2 then I want to sort by reference number
which is in column eight

I could work out how to do the seperate sorts ok, but I can't work out
how to do the multiple criteria sorts. Any ideas at all that might
help?

Thanks a lot

Regards

Carl

Well, if you haven't already used all columns in the worksheet you can
always consider including a new column, hidden if you like, where you
have the "secondary" sorting criteria calculated.
Say column 9 is at your disposal, then enter in cell I1 the following
=IF(G1=1;B1&A1;H1) and fill this down your table.
Then sort the entire table by columns 7 firstly and 9 secondly.

(You did not specify how the sorting should be when the result in
column 7 is 3. The above formula for simplicity uses the same as
for 2.)

Hope this helps / Lars-Åke
 
Top