ranking adjustment with countif formula

heathball

Board Regular
Joined
Apr 6, 2017
Messages
132
Office Version
  1. 365
Platform
  1. Windows
{=IF(ISERROR(AA2),DM2,COUNTIFS($DO:$DO,$DO2,AA:AA,"<"&AA2)+COUNTIFS($DO2:$DO2,$DO2,AA2:AA2,AA2))}

Hello, im trying to work out what i can add to this array formula, which will stop the 'equal numbers' appearing with the same duplicate rank number.

For example, it currently works like this

number - rank result from formula
19 - 1
20 - 2
21 - 3
21 - 3
22 - 6
21 - 3
23 - 7

but what i would like it to do is this

number - rank result from formula
19 - 1
20 - 2
21 - 3
21 - 4
22 - 6
21 - 5
23 - 7

if two numbers are equal, i prefer the number at the top (the lower row number) to have the lower number ranking, and for there to be no duplicate ranking results

is this possible to achieve within this formula?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
{=IF(ISERROR(AA2),AA2,COUNTIFS($DO:$DO,$DO2,AA:AA,"<"&AA2)+COUNTIFS($DO2:$DO2,$DO2,AA2:AA2,AA2))}

this is actually the correct array formula, not the one above
 
Upvote 0
You dont need array entry for countifs:

=IF(ISERROR(AA2),DM2,COUNTIFS(DO:DO,DO2,AA:AA,"<"&AA2)+COUNTIFS($DO$2:DO2,DO2,$AA$2:AA2,AA2))

The formula just needed a bit of cell absolution.
 
Upvote 0
ahh. It works great!
thats interesting.:)
i thought arrays were involved.

Which part of the formula is achieving the 'no duplicate ranking' part?

is it the "<" ( i cannot find any info on what this is actually doing)
or the $ you added to the $DO$2 and the $AA$2 ?

I guess as you say. its the change in absolutes. I will keep looking at this for a while. Thanks Very much
 
Last edited:
Upvote 0
This part is doing the no duplicates bit:

COUNTIFS($DO$2:DO2,DO2,$AA$2:AA2,AA2))

It produces 1 for the first time the conditions are met, 2 for the 2nd etc.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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