2007: RANK if 2 conditions are met.

Christiaan

Board Regular
Joined
Nov 5, 2012
Messages
81
Hello everyone!

I have a question about the RANK-function.
I need to have a ranking, simple enough with the RANK function. BUT... There need to be 2 criteria in 2 other cells met before a ranking is assigned.

For example:
Cell AC4 is attendance, needs to be "Y".
Cell AH4 is test result, needs to be "Passed".

If these two are true, then it needs to rank the value in AF4 (test result). The range of the cells is $AF$4:$AF$20.

I came up with this:
=IF(AND($AC4="Y";$AH4="Pass");RANK($AF4;$AF$4:$AF$20);"DNQ").

In my perception, this formula would say: Hey, if this person is present and passed the test, we need to give him a ranking. If he was not here, or failed the test, he DNQ (Did Not Qualify). That works partially.
The problem however... It will still look at the range ($AF$:$AF20) and assign a ranking based on that range. The result looks like this:

[TABLE="width: 420"]
<tbody>[TR]
[TD]n[/TD]
[TD]84,90%[/TD]
[TD]32,90%[/TD]
[TD]117,80%[/TD]
[TD]DNQ[/TD]
[TD]Att. error[/TD]
[/TR]
[TR]
[TD]y[/TD]
[TD]84,00%[/TD]
[TD]32,00%[/TD]
[TD]116,00%[/TD]
[TD]DNQ[/TD]
[TD]Fail -> N2[/TD]
[/TR]
[TR]
[TD]y[/TD]
[TD]85,10%[/TD]
[TD]32,50%[/TD]
[TD]117,60%[/TD]
[TD]2
[/TD]
[TD]Pass[/TD]
[/TR]
</tbody>[/TABLE]


The idea here is to have the rank in the 3rd row 1.
Any one know how to achieve this?!

Any help greatly appreciated.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Maybe...

=IF(AND($AC4="Y",$AH4="Pass"),COUNTIFS($AC$4:$AC$20,"y",$AH$4:$AH$20,"Pass",$AF$4:$AF$20,">"&AF4)+1,"DNQ")

M.
 
Upvote 0
Hello Marcelo!

This works like a charm. Tested it and it does come up with the right ranking!
Thank you!

Christiaan
 
Upvote 0

Forum statistics

Threads
1,223,244
Messages
6,170,976
Members
452,372
Latest member
Natalie18

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