Ranking without Duplicating Ranks

Preston Murphy
edited 01/18/22 inBest Practice

I used the RANKEQ function for the first time recently and realized that any identical values will have the same rank. It will skip however many duplicates you had in the ranking numbers, so you may have a ranking scheme that looks like 1, 2, 3, 3, 3, 6, 7, 7, 9, 9.


This may be useful in some situations but it is actually problematic in other situations. Let's say I am searching for the top 10 values in my set. I will not find a value for 4, 5, 8, or 10. This will of course be frustrating if I want to simply plot the top 10 values from my data set.


I have created the following formula to ignore duplicates and simply increment the rank of any duplicates by 1. This means any duplicates will have an arbitrary ranking to each other.


In this formula, "A" is the column being ranked.


RANK=RANKEQ([email protected], A:A) + COUNTIF(A$1:[email protected], RANKEQ(@cell, A:A) = RANKEQ([email protected], A:A)) - 1


Hopefully this helps someone!

Tags:

Comments