Excel RANK function: rank employees, students and products
RANK returns a value’s position in a list: 1st, 2nd… Descending and ascending order, ties, the $ trap, unique ranks and ranking within a group — with examples.
At the end of the month the manager asks: “Who is where in sales?”. You could sort the table, but that breaks the original order, and tomorrow’s new numbers mean doing it all again.
RANK works out each value’s position in a list without moving the table. When numbers change, the ranks update themselves.
Employee leaderboards, student scores, branch results, the fastest supplier — each is one formula.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Employee | Sales (m) | Rank | |
| 2 | Aziz | 48 | 5 | |
| 3 | Dilnoza | 62 | 1 | |
| 4 | Javohir | 55 | 3 | |
| 5 | Malika | 62 | 1 | |
| 6 | Sardor | 39 | 6 | |
| 7 | Nodira | 51 | 4 | |
| 8 |
Syntax
=РАНГ(number; ref; [order])
- number — the value to rank (for example,
B2). - ref — the whole list. Always lock it:
$B$2:$B$7. - order — optional: 0 or omitted ranks descending (largest is 1st: sales, scores); 1 ranks ascending (smallest is 1st: time, cost, number of errors).
Its modern name is RANK.EQ — same result. RANK.AVG gives tied values an average rank (1.5 instead of 1 and 2).
Entering RANK step by step
1
Select C2 and type =РАНГ(B2; — the first argument is the sales figure on this row.
2
Select B2:B7 with the mouse and press F4 right away — it becomes $B$2:$B$7. Close the bracket and press Enter.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Employee | Sales (m) | Rank | |
| 2 | Aziz | 481 | 5 | |
| 3 | Dilnoza | 62 | ||
| 4 | Javohir | 55 | ||
| 5 | Malika | 62 | ||
| 6 | Sardor | 39 | ||
| 7 | Nodira | 512 | ||
| 8 |
3
Double-click the fill handle at the corner of C2 — the formula copies down to the end of the table. Via fx: Вставить функцию → Statistical → RANK.EQ, with the fields Number, Ref and Order.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Employee | Sales (m) | Rank | |
| 2 | Aziz | 48 | 5 | |
| 3 | Dilnoza | 62 | ||
| 4 | Javohir | 55 | ||
| 5 | Malika | 62 | ||
| 6 | Sardor | 39 | ||
| 7 | Nodira | 51 | ||
| 8 |
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Driver | Delivery (min) | Rank | |
| 2 | Bobur | 42 | 4 | |
| 3 | Jasur | 38 | 2 | |
| 4 | Otabek | 45 | 5 | |
| 5 | Sherzod | 36 | 1 | |
| 6 | Ulugbek | 40 | 3 | |
| 7 |
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Employee | Sales | Wrong: no $ | Correct | |
| 2 | Aziz | 48 | 5 | 5 | |
| 3 | Dilnoza | 62 | 1 | 1 | |
| 4 | Javohir | 55 | 2 | 3 | |
| 5 | Malika | 62 | 1 | 1 | |
| 6 | Sardor | 39 | 2 | 6 | |
| 7 | Nodira | 51 | 1 | 4 | |
| 8 |
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Employee | Sales | RANK | Unique rank | |
| 2 | Aziz | 48 | 5 | 5 | |
| 3 | Dilnoza | 62 | 1 | 1 | |
| 4 | Javohir | 55 | 3 | 3 | |
| 5 | Malika | 62 | 1 | 2 | |
| 6 | Sardor | 39 | 6 | 6 | |
| 7 | Nodira | 51 | 4 | 4 | |
| 8 |
Pro level: rank within a group and a tie-breaker
- Rank within a group (a separate ranking in each branch):
=СЧЁТЕСЛИМН($A$2:$A$50;A2;$C$2:$C$50;">"&C2)+1— A is the branch, C the sales. RANK can’t do this; COUNTIFS can. - Tie-breaker (equal sales → more customers ranks higher):
=РАНГ(B2;$B$2:$B$7)+СЧЁТЕСЛИМН($B$2:$B$7;B2;$C$2:$C$7;">"&C2). - Percentile rank:
=PERCENTRANK.INC($B$2:$B$7;B2)— “this employee beats 80% of the team”. - A leaderboard: once you have unique ranks (example 3),
=ИНДЕКС($A$2:$A$7;ПОИСКПОЗ(1;$D$2:$D$7;0))returns the 1st-place name; swap 1 for 2 and 3 to build a Top 3. In Excel 365,=СОРТ(A2:B7;2;-1)orders the whole table instantly.
Try it in the simulator
Type =РАНГ(B2;$B$2:$B$7) in C2 and fill it down to C7. Then type =РАНГ(B2;$B$2:$B$7)+СЧЁТЕСЛИ($B$2:B2;B2)-1 in D2 and fill it down too — how were the ties split?
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Employee | Sales (m) | Rank | Unique | ||||||||||||||||||||
| 2 | Aziz | 48 | ||||||||||||||||||||||
| 3 | Dilnoza | 62 | ||||||||||||||||||||||
| 4 | Javohir | 55 | ||||||||||||||||||||||
| 5 | Malika | 62 | ||||||||||||||||||||||
| 6 | Sardor | 39 | ||||||||||||||||||||||
| 7 | Nodira | 51 | ||||||||||||||||||||||
| 8 | ||||||||||||||||||||||||
| 9 | ||||||||||||||||||||||||
| 10 | ||||||||||||||||||||||||
| 11 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.