View Single Post
  #1   Report Post  
DavidOakland DavidOakland is offline
Junior Member
 
Posts: 1
Default How do I match values in a sub set after a sort?

This is kind of complex I think, but I'm hoping someone might have an easy solution. I need to sort two columns for match parings, but the second column needs to match as closely to the nearest value of the grouping ahead of it. In other words, I need the sort to reverse itself after each whole number break in the first column. Here is an example:

Raw data
Score Comp
20 5
20 9
20 0
19 12
19 4
19 3
19 1
18 8
18 7
18 7

How I want it to come out:

Score Comp
20 9
20 5
20 0
19 1
19 3
19 4
19 12
18 8
18 7
18 7

The problem is simply doing a double sort gets this:

20 9
20 5
20 0
19 12
19 4
19 3
19 1
18 8
18 7
18 7

Any suggestions? Thank you all very much for your help.

David