Rank based on Multiple criteria (Like a RankIFS)

calecote

New Member
Joined
Oct 5, 2011
Messages
12
Hi,


I've read a lot of the forums on who to use rank based on multiple criteria, but I need to rank criteria based on multiple criteria.

I tried using something like this: =COUNTIF($B26:$T26,">"&N26)+1+SUMPRODUCT(--($B26:$T26=N26),--($B27:$T27>N27)) but it doesnt work for what I'm looking to do.

ChannelCategoryWeekUnitsSalesRank
GroceryApple17$18.002
GroceryApple17$21.001
GroceryApple22$6.001
GroceryOrange25$15.001
HomeApple13$9.002
HomeApple19$27.001
HomeApple23$9.001
RestaurantOrange25$15.002
RestaurantOrange27$21.001
RestaurantOrange21$3.003

<tbody>
</tbody>

I want to create one formula I can drag down that chooses the most units than the most sales based on the criteria of Channel, category and week.

Thanks,

Cale
 
A Pivot Table is a good option, and pretty easy to run, once you've seen it.

If you're still looking for a formula, you didn't really say how you wanted the output to look. Here are a few possibilities:

ABCDEFGHI
1RestaurantPeople thereRankTotalRankRestaurant
2Italian201901Italian90
3Greek175175Chinese75
4Sushi403403Sushi40
5Chinese752752Soup30
6Italian35Greek17
7Burger175175Burger17
8Soup304304Mexican15
9Mexican15715700
10Italian350
11
12

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet3

Worksheet Formulas
CellFormula
I2=SUMIF($A$2:$A$20,H2,$B$2:$B$20)
D2=IF(COUNTIF($A$2:$A2,A2)>1,"",SUMIF($A$2:$A$20,A2,$B$2:$B$20))
E2=IFERROR(RANK(D2,$D$2:$D$20),"")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
H2{=IFERROR(INDEX($A$2:$A$20,MATCH(MAX(IF(ISERROR(MATCH($A$2:$A$20,$H$1:$H1,0)),SUMIF($A$2:$A$20,$A$2:$A$20,$B$2:$B$20),-1)),IF(ISERROR(MATCH($A$2:$A$20,$H$1:$H1,0)),SUMIF($A$2:$A$20,$A$2:$A$20,$B$2:$B$20),-2),0)),"")}
C2{=IF(A2="","",IF(COUNTIF($A$2:$A2,A2)>1,"",SUM(IF((SUMIF($A$2:$A$20,A2,$B$2:$B$20)<SUMIF($A$2:$A$20,$A$2:$A$20,$B$2:$B$20))*(IF($A$2:$A$20="",0,MATCH($A$2:$A$20,$A$2:$A$20,0)=ROW($A$2:$A$20)-ROW($A$2)+1)),1))+1))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



Column C is a formula that creates the ranking, without needing a helper column. Duplicate entries are blank. Columns D and E achieve the same thing using 2 columns, but the formulas are far simpler.

Column H is a helper free formula that ranks the restaurants by people. Column I is just a SUMIF to get the matching count.

I seem to remember doing something very similar a long time ago a bit more elegantly. I'll see if I can dig it up.
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
The data is going to be posted to the bottom and a Pivot table would work, but I was hoping there was a single formula that could be inputted next to the sata that essentially had the ability to cumulitively sum. If not I would just build a separate sumif table.
 
Upvote 0
Welcome to the board.

For future reference, it's probably best to open a new thread with a new question, and not add to a very old thread. You'll get more eyes on it.

Secondly, I'm trying to figure out exactly what you want. I see a list of names and times. Some of the names are repeated. How exactly do you want to rank them? If it's by lowest average delivery time, you'll need a start and an end time for each delivery. If you just want a rank of most deliveries, that's possible, although it would be easier to use a pivot table (which I can explain if you want). If you want a ranking by some other method, let me know.
 
Upvote 0

Forum statistics

Threads
1,216,116
Messages
6,128,933
Members
449,480
Latest member
yesitisasport

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