Rank with preceeding criteria

tbecker3

New Member
Joined
Feb 17, 2016
Messages
27
Hi,
I need a Rank function which the inclusion of Rank is based on weather another column in the file is populated with an X.
So, Rank column AF, if Column C contains an X.
Thanks.
 

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
Hi,
I need a Rank function which the inclusion of Rank is based on weather another column in the file is populated with an X.
So, Rank column AF, if Column C contains an X.
Thanks.

In AG2 enter and copy down:

=COUNTIFS($C$2:$C$400,"X",$AF$2:$AF$400,">"&AF2)+1
 
Upvote 0
A B Rank of column B if A = X
135
1
X 8 1
X 213 3
X 378 5
X 54 2
X 264 4
20
58

Note the rows without an X are not included in the Rank in column C, essentially they are skipped for the Ranking. Is there a function for this? Thank You!
 
Upvote 0
A B Rank of column B if A = X
135
1
X 8 1
X 213 3
X 378 5
X 54 2
X 264 4
20
58

Note the rows without an X are not included in the Rank in column C, essentially they are skipped for the Ranking. Is there a function for this? Thank You!

In AG2 enter and copy down:

=IF($C2="X",COUNTIFS($C$2:$C$10,"X",$AF$2:$AF$10,"<"&AF2)+1,"")
 
Upvote 0
Yeah, much closer! Results are returning a 1 when AF is blank. Is there a way to eliminate consideration in Rank if AF is blank? If I change the last part to "-1" will the results change to descending order? That's how my boss likes it!
 
Upvote 0
Yeah, much closer! Results are returning a 1 when AF is blank. Is there a way to eliminate consideration in Rank if AF is blank? If I change the last part to "-1" will the results change to descending order? That's how my boss likes it!

Ascending...

=IF($C2="X",IF(ISNUMBER($AF2),COUNTIFS($C$2:$C$10,"X",$AF$2:$AF$10,"<"&AF2)+1,""),"")

Descending...

=IF($C2="X",IF(ISNUMBER($AF2),COUNTIFS($C$2:$C$10,"X",$AF$2:$AF$10,">"&AF2)+1,""),"")
 
Upvote 0

Forum statistics

Threads
1,223,931
Messages
6,175,465
Members
452,646
Latest member
tudou

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