What is the RANK.EQ function?
=RANK.EQ(number, ref, [order])RANK.EQ returns where a value ranks within a range, for example exam or sales rankings.
According to Microsoft, equal values get the same rank and the following ranks are skipped. Click the two 88 cells to compare.
RANK.EQ shows position in a list: class rankings, sales leaderboards, race times. Ties share a rank and the next rank is skipped, giving 1, 2, 2, 4. For a ranking within each group, use COUNTIFS.
Arguments
- number
- The value to rank.
- ref
- The values to compare against. Non-numbers are ignored.
- order
- 0 or omitted: largest is 1st (descending). Any other value: smallest is 1st (ascending).
RANK.EQ examples
Example 1. Score rank
=RANK.EQ(B3, B2:D6, 0)92 comes after 95, so it ranks 2nd.
Example 2. Tied scores
=RANK.EQ(D3, B2:D6)88 appears twice; both rank 5th and the next, 87, ranks 7th.
Example 3. When copying
=RANK.EQ(B2, $B$2:$D$6)Lock the range with absolute references.
Example 4. Descending and ascending
=RANK.EQ(B2, $B$2:$B$6, order)Scores rank high to low (order 0); times rank low to high (order 1).
Value Order 0 (descending) Order 1 (ascending) 95 1 5 92 2 4 88 3 2 88 3 2 80 5 1 Example 5. Rank within a branch
=COUNTIFS($A$2:$A$9, A2, $D$2:$D$9, ">"&D2)+1Counts larger sales in the same branch and adds 1. Seoul's 96000 is 1st within Seoul.
Common mistakes
Copying a relative range
The range shifts as you copy and the ranks go wrong. Add $.
Order reversed
For smallest-is-best values (race times), use 1.
Wanting distinct ranks for ties
=RANK.EQ(B2, $B$2:$B$6)+COUNTIF($B$2:B2, B2)-1 adds the order of appearance, so tied values get different ranks.
FAQ
- How is it different from RANK?
- The result is the same. RANK is kept for compatibility.
- Average rank for ties?
- Use RANK.AVG.