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.

Excel formula: Rank function example

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.

Excel formula: Rank race results

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.

Excel formula: nth largest value

top sales) as well as smallest to largest (i.e.

How to rank values with the RANK function

Excel formula: Rank without ties

Excel formula: Break ties with helper column and COUNTIF

Excel COUNTIFS function

Excel RANK function

Article image