Explanation
Although Excel has aRANK function, there is no RANKIF function to perform a conditional rank.
However, you could easily create a conditional RANK with the COUNTIFS function.
The COUNTIFS function can perform a conditional count using two or more criteria.
Criteria are entered in range/criteria pairs.
To get a proper rank, we simply add 1 to the number returned by COUNTIFS.
Reversing rank order
To reverse rank order and rank in order (i.e.
Duplicates
Like theRANK function, the formula on this page will assign duplicate values the same rank.
When a value has no duplicates, the above code returns zero and has no effect.
RANK can rank values from largest to smallest (i.e.
top sales) as well as smallest to largest (i.e.