Find Rank

Robin_

New Member
Joined
Aug 29, 2014
Messages
13
How to find the rank of only passed students.
Here is a part of Mark sheet I prepared.
I need to find the rank of only passed students.

That means, in my problem,
ABC should get 2
DEF should get 0 or "FAIL" or "No Rank"
GHI should get 3
and JKL should get 1

In this problem, there is no incidence of tie. But, in my real problem, there can occur tie. And, for tie, the rank version of 1, 2, 3, 3, 5, 6 is okay.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Name[/TD]
[TD="align: center"]Total[/TD]
[TD="align: center"]Result[/TD]
[TD="align: center"]Rank[/TD]
[/TR]
[TR]
[TD]ABC[/TD]
[TD="align: center"]89[/TD]
[TD="align: center"]PASS[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]DEF[/TD]
[TD="align: center"]45[/TD]
[TD="align: center"]FAIL[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]GHI[/TD]
[TD="align: center"]85[/TD]
[TD="align: center"]PASS[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JKL[/TD]
[TD="align: center"]95[/TD]
[TD="align: center"]PASS[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Thanks in advance.
 
Maybe...


[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
A
[/TD]
[TD]
B
[/TD]
[TD]
C
[/TD]
[TD]
D
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD]
Name​
[/TD]
[TD]
Total​
[/TD]
[TD]
Result​
[/TD]
[TD]
Rank​
[/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD]
ABC​
[/TD]
[TD]
89​
[/TD]
[TD]
PASS​
[/TD]
[TD]
2​
[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD]
DEF​
[/TD]
[TD]
45​
[/TD]
[TD]
FAIL​
[/TD]
[TD]
No Rank​
[/TD]
[/TR]
[TR]
[TD]
4
[/TD]
[TD]
GHI​
[/TD]
[TD]
85​
[/TD]
[TD]
PASS​
[/TD]
[TD]
3​
[/TD]
[/TR]
[TR]
[TD]
5
[/TD]
[TD]
JKL​
[/TD]
[TD]
95​
[/TD]
[TD]
PASS​
[/TD]
[TD]
1​
[/TD]
[/TR]
</tbody>[/TABLE]


Formula in D2 copied down
=IF(C2="FAIL","No Rank",COUNTIFS(B:B,">"&B2,C:C,C2)+1)

Hope this helps

M.

What if, I have different way to award rank for ties?

I required to rank as following.

Excel and above formula as well provides the rank like this => 1, 1, 3, 4, 5 for two first values in tie.
But, I need like this..... 1, 1, 2, 3, 4

How that can be done?
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
What if, I have different way to award rank for ties?

I required to rank as following.

Excel and above formula as well provides the rank like this => 1, 1, 3, 4, 5 for two first values in tie.
But, I need like this..... 1, 1, 2, 3, 4

How that can be done?

Care to provide an appropriate sample along with the desired ranking?
 
Upvote 0
How to find the rank of only passed students.
Here is a part of Mark sheet I prepared.
I need to find the rank of only passed students.

That means, in my problem,
ABC should get 2
DEF should get 0 or "FAIL" or "No Rank"
GHI should get 3
and JKL should get 1

In this problem, there is no incidence of tie. But, in my real problem, there can occur tie. And, for tie, the rank version of 1, 2, 3, 3, 5, 6 is okay.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Name[/TD]
[TD="align: center"]Total[/TD]
[TD="align: center"]Result[/TD]
[TD="align: center"]Rank[/TD]
[/TR]
[TR]
[TD]ABC[/TD]
[TD="align: center"]89[/TD]
[TD="align: center"]PASS[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]DEF[/TD]
[TD="align: center"]45[/TD]
[TD="align: center"]FAIL[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]GHI[/TD]
[TD="align: center"]85[/TD]
[TD="align: center"]PASS[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]JKL[/TD]
[TD="align: center"]95[/TD]
[TD="align: center"]PASS[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Thanks in advance.

Hi Aladin Akyurek,

If I have understood correctly, you need sample data for the ranking. And, the above quote is my real question.
I found answer of Marcelo useful. Which was to be calculated with the formula below.
=IF(C2="FAIL","No Rank",COUNTIFS(B:B,">"&B2,C:C,C2)+1)

This formula will award rank for ties as follows.
If two values are equal and lies in 2nd position, then ranking will be 1, 2, 2, 4, 5

But, now, I need, the ranking as 1, 2, 2, 3, 4 for two tie value in 2nd position.

Hope, I made it clear.

Thanks.
 
Upvote 0
Hi Aladin Akyurek,

If I have understood correctly, you need sample data for the ranking. And, the above quote is my real question.
I found answer of Marcelo useful. Which was to be calculated with the formula below.
=IF(C2="FAIL","No Rank",COUNTIFS(B:B,">"&B2,C:C,C2)+1)

This formula will award rank for ties as follows.
If two values are equal and lies in 2nd position, then ranking will be 1, 2, 2, 4, 5

But, now, I need, the ranking as 1, 2, 2, 3, 4 for two tie value in 2nd position.

Hope, I made it clear.

Thanks.

No. As far as I know the formula gives 2, No rank, 3, 1 for the sample you quote, while I'm asking for a sample where you "need, the ranking as 1, 2, 2, 3, 4 for two tie value in 2nd position" instead of the set 1, 2, 2, 4, 5 you state the Branco formula would deliver.
 
Upvote 0
Ohh I got you now.

That was only a sample problem exactly same as I have here in real.
So, I can extend the same question as per my requirement.


[TABLE="class: cms_table_grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Name[/TD]
[TD="align: center"]Total[/TD]
[TD="align: center"]Result[/TD]
[TD="align: center"]Rank[/TD]
[/TR]
[TR]
[TD]ABC[/TD]
[TD="align: center"]99[/TD]
[TD="align: center"]PASS[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]DEF[/TD]
[TD="align: center"]89[/TD]
[TD="align: center"]PASS[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]GHI[/TD]
[TD="align: center"]89[/TD]
[TD="align: center"]PASS[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]JKL[/TD]
[TD="align: center"]40[/TD]
[TD="align: center"]FAIL[/TD]
[TD]No Rank[/TD]
[/TR]
[TR]
[TD]MNO[/TD]
[TD="align: center"]85[/TD]
[TD="align: center"]PASS[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]PQR[/TD]
[TD="align: center"]75[/TD]
[TD="align: center"]PASS[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]



Here, I need the rank....... 1, 2, 2, No Rank, 3, 4.

Now, How can Marcelo's formula be edited/corrected or we construct any new formula?

Please help.
 
Upvote 0
[Table="width:, class:grid"][tr][td] [/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][td]
E​
[/td][/tr]
[tr][td]
1​
[/td][td]
Name​
[/td][td]
Total​
[/td][td]
Result​
[/td][td]
Rank​
[/td][td]
[/td][/tr]

[tr][td]
2​
[/td][td]Alan[/td][td]
99​
[/td][td]PASS[/td][td]
1​
[/td][td]D2: =IF(C2 <> "pass", "No rank", SUMPRODUCT((B2 < B$2:B$7) * ($C$2:$C$7 = "pass") / (COUNTIF(B$2:B$7, B$2:B$7 & "")))+1)[/td][/tr]

[tr][td]
3​
[/td][td]Barb[/td][td]
89​
[/td][td]PASS[/td][td]
2​
[/td][td][/td][/tr]

[tr][td]
4​
[/td][td]Cain[/td][td]
89​
[/td][td]PASS[/td][td]
2​
[/td][td][/td][/tr]

[tr][td]
5​
[/td][td]Dana[/td][td]
40​
[/td][td]FAIL[/td][td]No rank[/td][td][/td][/tr]

[tr][td]
6​
[/td][td]Eric[/td][td]
85​
[/td][td]PASS[/td][td]
3​
[/td][td][/td][/tr]

[tr][td]
7​
[/td][td]Fran[/td][td]
75​
[/td][td]PASS[/td][td]
4​
[/td][td][/td][/tr]
[/table]
 
Last edited:
Upvote 0
Ohh I got you now.
...

A bit late though:laugh:...

A different take (possibly faster)...

D2, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF($C2="pass",SUM(IF(FREQUENCY(IF($C$2:$C$7="pass",
  IF($B$2:$B$7>$B2,$B$2:$B$7)),$B$2:$B$7),1))+1,"No Rank")
 
  • Like
Reactions: shg
Upvote 0

Forum statistics

Threads
1,224,886
Messages
6,181,594
Members
453,056
Latest member
Jonasanas

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