Rank with criteria

ORoxo

Board Regular
Joined
Oct 30, 2016
Messages
149
Hey, guys,
I'm really going crazy with this as I have not been able to figure it out for a couple of days.
Let's take the following picture as an example:

drop-down-formula-to-data-table-to-create-rank-if-with-sumproduct-for-conditional-ranking-min.png


I'm basically looking for a formula on input on column D which does the exact same thing but with one exception. Let's say we on row 21 we have data exactly as we do on row 19. In that case, I want the formula to return the "2" as it did on row 19.

Any idea how this can be achieved?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
So you want to match columns A, B & C and lookup what their score was in column D? Could you try the below entered in D21

=IF(SUMPRODUCT((A21=$A$1:A20)*(B21=$B$1:B20)*(C21=$C$1:C20))=1,SUMPRODUCT((A21=$A$1:A20)*(B21=$B$1:B20)*(C21=$C$1:C20),$D$1:D20),"")
 
Upvote 0
So you want to match columns A, B & C and lookup what their score was in column D? Could you try the below entered in D21

=IF(SUMPRODUCT((A21=$A$1:A20)*(B21=$B$1:B20)*(C21=$C$1:C20))=1,SUMPRODUCT((A21=$A$1:A20)*(B21=$B$1:B20)*(C21=$C$1:C20),$D$1:D20),"")

Unfortunately, it didn't work, Barry
 
Upvote 0
In D2 control+shift+enter, not just enter, and copy down:

=SUM(IF(FREQUENCY(IF($C$2:$C$21=C2,IF($B$2:$B$21>$B2,$B$2:$B$21)),$B$2:$B$21),1))+1

We are soooo soooo close...

The only problem with this is if there are two distinct students in the same department with the same grade. Assuming there are two students with the same top grade, in that case, the formula should rank one of them as 1 and the other one as 2. However, its currently ranking both as 1.

Note to self: I reallt need to study FREQUENCY function
 
Last edited:
Upvote 0
We are soooo soooo close...

The only problem with this is if there are two distinct students in the same department with the same grade. Assuming there are two students with the same top grade, in that case, the formula should rank one of them as 1 and the other one as 2. However, its currently ranking both as 1.

Note to self: I reallt need to study FREQUENCY function

Try to create a sample including this new condition along with the expected results (manually).
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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