What is the RANK function?
=RANK(number, ref, [order])RANK returns where a value ranks within a range. With order omitted or 0, the largest value is 1st; with 1, the smallest value is 1st.
Microsoft lists RANK as a compatibility function and recommends RANK.EQ, which calculates the same. Equal values all get the highest rank.
Arguments
- number
- The value to rank.
- ref
- The values to compare against. Usually locked with $.
- order
- 0 or omitted: descending (largest is 1st). 1: ascending.
RANK examples
Example 1. Score rank
=RANK(B2, $B$2:$B$6)Lock the range so it does not shift when copied down.
Example 2. Times (smaller is better)
=RANK(B2, $B$2:$B$6, 1)Use when the smallest value should rank 1st.
Example 3. Average rank for ties
=RANK.AVG(B2, $B$2:$B$6)Gives tied values the average of their ranks.
Common mistakes
Range not locked
The range shifts when copied and the ranks go wrong. Lock it like $B$2:$B$6.
A value outside the range
A value that is not in ref returns #N/A.
FAQ
- RANK or RANK.EQ?
- The results are the same. RANK is the older compatibility name.
- What comes after a tie?
- If two values tie for 2nd, the next is 4th; 3rd is skipped.