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.

TRUE TRUE5.46E+08
TRUE FALSE31263409
TRUE TRUE58662625
TRUE TRUE2.36E+08
FALSE TRUE23933559
TRUE TRUE44886052

<tbody>
</tbody>

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

TRUE TRUE5456811531
TRUE TRUE312634095
TRUE TRUE586626253
TRUE FALSE235698268FALSE
TRUE TRUE239335596
TRUE FALSE44886052FALSE

<tbody>
</tbody>
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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
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,215,329
Messages
6,124,301
Members
449,149
Latest member
mwdbActuary

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