Excel function

RANKfunction

Returns the rank of a value within a range. A compatibility function that calculates the same as RANK.EQ.

All versions
=RANK(B3, B2:D6, 0)
A
B
C
D
1
2
3
4
5
6

Drag the corner dots to change ref. Click a cell in the table to change number. Click 88. The score appears twice, so both get the same rank. Try breaking it on purpose to see the errors.

Result

2

number
B3You can also click a cell in the table

The cell with the number to rank. Click another score in the table.

ref
B2:D6Drag the corner dots on the table

The cells to calculate. Cells that are not numbers are ignored.

order

0 (or omitted): the largest value ranks 1. 1: the smallest value ranks 1.

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

  1. Example 1. Score rank

    =RANK(B2, $B$2:$B$6)

    Lock the range so it does not shift when copied down.

  2. Example 2. Times (smaller is better)

    =RANK(B2, $B$2:$B$6, 1)

    Use when the smallest value should rank 1st.

  3. Example 3. Average rank for ties

    =RANK.AVG(B2, $B$2:$B$6)

    Gives tied values the average of their ranks.

Common mistakes

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.