Multi-condition sorting issue

Oldsquid

New Member
Joined
Sep 15, 2011
Messages
9
Office Version
  1. 365
Platform
  1. Windows
I would like to do, for lack of better description, a double sort on two set of numbers, based on a 3rd (variable) number.
Score 41 45 52 45 38 52 47 35 42 34
Names Adam Danille Davy Dori Bill Mom Randy Angi Shane
# Wins 11 10 10 9 10 10 10 11 9

I would like it to sort by number of wins, then, closest, but not over the score, then over the score. Then, go to the next highest number of wins and do the same thing again. To show 1st, 2nd and 3rd place.

To look like this:

Angi Adam Randy
11 11 10
1 2 3
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Try:
Book1
ABCDEFGH
1Score41Check for
2ScoreNamesWinsClosestNamesWinsClosest
345Adam114Angi111
452Danille1011Adam114
545Davy104Randy10-6
638Dori9-3
752Bill1011
847Mom106
935Randy10-6
1042Angi111
1134Shane9-7
Sheet3
Cell Formulas
RangeFormula
F3:H5F3=TAKE(SORTBY($B$3:$D$11,$C$3:$C$11,-1,$A$3:$A$11-$B$1,1),3)
D3:D11D3=A3-$B$1
Dynamic array formulas.
 
Upvote 0
I copied this to my sheet, I'm getting an error: " A value used in the formula is of the wrong data type."

Could you advise what I'm missing?


I have tried to install XL2BB, but 365 doesn't allow it to run.
 
Upvote 0
Try this:
Note I changed the way you calculated the difference. I subtracted their score from the actual score based on your quote of "then, closest, but not over the score, then over the score".
Book1
KLMNOPQRSTUV
34
3541455245385247354234
36
37NamesAdamDanilleDavyDoriBillPimp NanaRandyAngiShane
38# Wins1110109101010119
39Difference4114-3116-61-7
40
41NamesAngiAdamRandy
42# Wins111110
43Difference14-6
Sheet1
Cell Formulas
RangeFormula
N39:V39N39=N35-$K$35
N41:P43N41=TAKE(SORTBY($N$37:$V$39,$N$38:$V$38,-1,N39:V39,1),,3)
Dynamic array formulas.
 
Upvote 1
Solution
Thank you so much!!!
I had never seen the function Take() before; I'll have to look into it to expand my function knowledge.
 
Upvote 0
You're welcome thanks for the feedback. I noticed it looked like you had some merged cells in your worksheet. It is usually best to avoid merged cells as they can cause problems with formulas that try to use a merged cell.
Also, below is a link on the take function. It starts at the 3:44 mark in the video.
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,589
Members
449,174
Latest member
chandan4057

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top