Ranking with TRUE or FALSE and without Skipping numbers (NO DUPLICATES)

Masha92

Board Regular
Joined
Jan 27, 2019
Messages
51
Office Version
  1. 365
Hi everyone,

I am trying to rank data with conditions.

[TABLE="width: 192"]
<tbody>[TR]
[TD="width: 64, align: center"]TRUE[/TD]
[TD="class: xl67, width: 64, align: center"] TRUE[/TD]
[TD="width: 64, align: right"]5.46E+08[/TD]
[/TR]
[TR]
[TD="align: center"]TRUE[/TD]
[TD="class: xl67, align: center"] FALSE[/TD]
[TD="align: right"]31263409[/TD]
[/TR]
[TR]
[TD="align: center"]TRUE[/TD]
[TD="class: xl67, align: center"] TRUE[/TD]
[TD="align: right"]58662625[/TD]
[/TR]
[TR]
[TD="align: center"]TRUE[/TD]
[TD="class: xl67, align: center"] TRUE[/TD]
[TD="align: right"]2.36E+08[/TD]
[/TR]
[TR]
[TD="align: center"]FALSE[/TD]
[TD="class: xl67, align: center"] TRUE[/TD]
[TD="align: right"]23933559[/TD]
[/TR]
[TR]
[TD="align: center"]TRUE[/TD]
[TD="class: xl67, align: center"] TRUE[/TD]
[TD="align: right"]44886052[/TD]
[/TR]
</tbody>[/TABLE]

When i rank using sumproducts or countif... it skips numbers. so ideally i get,

[TABLE="width: 282"]
<tbody>[TR]
[TD="align: center"]TRUE[/TD]
[TD="align: center"] TRUE[/TD]
[TD="align: right"]545681153[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: center"]TRUE[/TD]
[TD="align: center"] TRUE[/TD]
[TD="align: right"]31263409[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: center"]TRUE[/TD]
[TD="align: center"] TRUE[/TD]
[TD="align: right"]58662625[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: center"]TRUE[/TD]
[TD="align: center"] FALSE[/TD]
[TD="align: right"]235698268[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
[TR]
[TD="align: center"] TRUE[/TD]
[TD="align: center"] TRUE[/TD]
[TD="align: right"]23933559[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: center"]TRUE[/TD]
[TD="align: center"] FALSE[/TD]
[TD="align: right"]44886052[/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
</tbody>[/TABLE]
My formula is
<u$3:u$8) countif(u$3:u$8,u$3:u$8&""))+1)<u$3:u$8)="" countif(u$3:u$8,u$3:u$8&""))+1)
<u>IF (AND(T3,S3), SUMPRODUCT((U3<U$3:U$8) / COUNTIF (U$3:U$8,U$3:U$8&"")) +1)</u>
<u$3:u$8) countif(u$3:u$8,u$3:u$8&""))+1)
Any help on this? I cannot afford skipping numbers. I.e Number 3 in the previous example should be 2.

Thanks,
Masha</u$3:u$8)></u$3:u$8)>
 
Last edited:

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Your formula is not displaying correctly.
Places spaces before and after any < > characters in your formula when posting to the forum.
 
Upvote 0
Your formula is not displaying correctly.
Places spaces before and after any < > characters in your formula when posting to the forum.

Thank you so much for the tip!

=IF(AND(W2,V2),SUMPRODUCT((X2 < X$2:X$7)/COUNTIF(X$2:X$7,X$2:X$7&""))+1)
 
Upvote 0
I dont have to use this formula. If you have a formula that can solve this issue, you would be a life saver. And not with VBA, I already did it and got rejected at work. It has to be macro free template!
 
Upvote 0
Your IF condition is incomplete.

IF(condition, value if true, value if false)

Your formula
=IF(AND(W2,V2),SUMPRODUCT((X2 < X$2:X$7)/COUNTIF(X$2:X$7,X$2:X$7&""))+1)

condition = AND(W2,V2) = So W2 has to be TRUE and V2 has to be TRUE
value if true = SUMPRODUCT((X2 < X$2:X$7)/COUNTIF(X$2:X$7,X$2:X$7&""))+1
value if false = Nothing supplied, that's why you're getting the default of FALSE because one or both of W2 V2 is FALSE
 
Upvote 0
Hang on, I see what you mean.

You only want to RANK if both conditions are TRUE but it's ranking value where V2 or W2 are FALSE

I understand now.

Thinking...
 
Last edited:
Upvote 0
Hang on, I see what you mean.

You only want to RANK if both conditions are TRUE but it's ranking value where V2 or W2 are FALSE

I understand now.

Thinking...

yes exactly, the false condition doesnt matter really. I just need to rank the true only and without skipping the numbers.. :)
 
Upvote 0
Not the best way but this looks like it's working

=IFERROR(COUNTIFS(V$2:V$7,TRUE,W$2:W$7,TRUE,IF(V2*W2=1,X$2:X$7), ">"&X2)+1,"")
and copy down the column

This may well be an array formula but works without entering it as one.
Might be best to enter some test data just to confirm that.

Googling RANK IF comes up with COUNTIFS solutions
 
Last edited:
Upvote 0
It works.. it works!!! and not array!! Hurray!

Thank you so much. I am grateful.
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
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