Rank in Excel, and find the top 5
=RANK(B2,$B$2:$B$13) gives the score in B2 its place in the list: 1 for the highest. For the top 5 scores themselves, use =LARGE($B$2:$B$13,1), then 2, 3, 4 and 5, and INDEX with MATCH to put the name beside each one. RANK, LARGE and SMALL work in every version of Excel, on Windows and Mac and in Excel for the web.
Ranking at a glance
| You want | Formula | Notes |
|---|---|---|
| A rank, highest first | =RANK(B2,$B$2:$B$13) | Lock the list with $ |
| A rank, lowest first | =RANK(B2,$B$2:$B$7,1) | For times, where lowest is best |
| A rank with no ties | =RANK(B2,$B$2:$B$7)+COUNTIF($B$2:B2,B2)-1 | The first one listed goes higher |
| A rank within each group | =COUNTIFS($B$2:$B$9,B2,$C$2:$C$9,">"&C2)+1 | Such as a rank in each region |
| The 3rd highest score | =LARGE($B$2:$B$13,3) | SMALL gives the 3rd lowest |
| The name beside a top score | =INDEX($A$2:$A$13,MATCH(E2,$B$2:$B$13,0)) | Ties show the first name twice |
| The top 5 rows in one go | =TAKE(SORT(A2:B13,2,-1),5) | Excel 365 and 2024 |
Each one is worked through below.
A worked example: RANK
Twelve people took a quiz, with their scores in column B. Nia scored 91, which is higher than everyone else, so Nia is 1st. Priya's 88 is beaten only by Nia's 91, so Priya is 2nd. RANK counts how many scores are higher and adds 1. Ollie's 45 is beaten by all 11 others, so Ollie is 12th.
=RANK(B2,$B$2:$B$13)
B2is the score to rank.$B$2:$B$13is the whole list, locked with $ so every row compares against the same list (see absolute references).
| A | B | C | |
|---|---|---|---|
| 1 | Name | Score | Rank |
| 2 | Grace | 67 | 8 |
| 3 | Tom | 54 | 11 |
| 4 | Priya | 88 | 2 |
| 5 | Marek | 72 | 6 |
| 6 | Nia | 91 | 1 |
| 7 | Ollie | 45 | 12 |
| 8 | Amira | 79 | 5 |
| 9 | Ben | 63 | 9 |
| 10 | Cara | 85 | 3 |
| 11 | Dev | 58 | 10 |
| 12 | Ewa | 70 | 7 |
| 13 | Finn | 82 | 4 |
To add the $ signs, click on B2:B13 in the formula and press F4 (on a Mac, Cmd+T, or Fn+F4 on some keyboards). RANK.EQ is the same function under its newer name, and gives the same answers.
Lowest first: times and costs
In a race, the lowest time wins. Add a 1 on the end of RANK to give the lowest number 1st. Jo's 21.8 minutes is the fastest, so Jo is 1st; Sam's 27.3 is the slowest of six, so 6th.
| A | B | C | |
|---|---|---|---|
| 1 | Runner | Minutes | Place |
| 2 | Ali | 24.5 | 4 |
| 3 | Bea | 22.1 | 2 |
| 4 | Sam | 27.3 | 6 |
| 5 | Jo | 21.8 | 1 |
| 6 | Kit | 25 | 5 |
| 7 | Lee | 23.4 | 3 |
Leave the last part off (or put 0) for highest first. The same goes for anything where less is better: costs, days absent, mistakes.
Ties
In this shorter list, Lola and Cara both scored 85. Two scores are higher (Nia's 91 and Priya's 88), so RANK gives them both 3rd, and nobody is 4th. That's how most results tables show a tie. RANK.AVG shares the places out instead: they would be 3rd and 4th, so each gets 3.5.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Name | Score | RANK | RANK.AVG | No ties |
| 2 | Nia | 91 | 1 | 1 | 1 |
| 3 | Priya | 88 | 2 | 2 | 2 |
| 4 | Lola | 85 | 3 | 3.5 | 3 |
| 5 | Cara | 85 | 3 | 3.5 | 4 |
| 6 | Finn | 82 | 5 | 5 | 5 |
| 7 | Marek | 72 | 6 | 6 | 6 |
When every place must be different, such as for a numbered list, column E adds a tie-break. COUNTIF($B$2:B2,B2) counts how many times this score has come up so far. Only the start of that range is locked, so it grows as the formula goes down. For Lola it's 1, so Lola stays 3rd. For Cara it's 2, so Cara moves to 4th.
The top 5: LARGE
LARGE gives the biggest number in a list, or the 2nd biggest, the 3rd, and so on. Put 1 to 5 in a column and point LARGE at each:
=LARGE($B$2:$B$13,D2)
To show whose score it is, MATCH finds which row has that score and INDEX brings back the name from the same row (see INDEX and MATCH):
=INDEX($A$2:$A$13,MATCH(E2,$B$2:$B$13,0))
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Name | Score | Place | Score | Name | |
| 2 | Grace | 67 | 1 | 91 | Nia | |
| 3 | Tom | 54 | 2 | 88 | Priya | |
| 4 | Priya | 88 | 3 | 85 | Cara | |
| 5 | Marek | 72 | 4 | 82 | Finn | |
| 6 | Nia | 91 | 5 | 79 | Amira | |
| 7 | Ollie | 45 | ||||
| 8 | Amira | 79 | ||||
| 9 | Ben | 63 | ||||
| 10 | Cara | 85 | ||||
| 11 | Dev | 58 | ||||
| 12 | Ewa | 70 | ||||
| 13 | Finn | 82 |
The bottom 5 work the same way with SMALL: =SMALL($B$2:$B$13,1) is the lowest score, 45. If two people tie, LARGE gives their score twice, but MATCH always finds the first person with that score, so the first name shows twice. The next way keeps both names.
The top 5 in one go (Excel 365)
In Excel 365 and Excel 2024, sort the whole table by score, biggest first, and keep the first 5 rows. One formula spills the names and scores together, and tied people each keep their own name:
=TAKE(SORT(A2:B13,2,-1),5)
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Name | Score | Top 5 | ||
| 2 | Grace | 67 | Nia | 91 | |
| 3 | Tom | 54 | Priya | 88 | |
| 4 | Priya | 88 | Cara | 85 | |
| 5 | Marek | 72 | Finn | 82 | |
| 6 | Nia | 91 | Amira | 79 | |
| 7 | Ollie | 45 | |||
| 8 | Amira | 79 | |||
| 9 | Ben | 63 | |||
| 10 | Cara | 85 | |||
| 11 | Dev | 58 | |||
| 12 | Ewa | 70 | |||
| 13 | Finn | 82 |
The 2 means sort by the 2nd column, and -1 means biggest first. See SORT and SORTBY and TAKE. To keep everyone who ties with 5th place, filter instead: =SORT(FILTER(A2:B13,B2:B13>=LARGE(B2:B13,5)),2,-1).
A rank within each group
To rank people within their own region, count how many people in the same region scored higher, and add 1. In the North, only Nia (91) and Cara (85) beat Finn's 82, so Finn is 3rd in the North, even though Ben, in the South, scored less than Finn and is 1st there.
=COUNTIFS($B$2:$B$9,B2,$C$2:$C$9,">"&C2)+1
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Name | Region | Score | Rank in region |
| 2 | Grace | North | 67 | 4 |
| 3 | Tom | South | 54 | 3 |
| 4 | Nia | North | 91 | 1 |
| 5 | Ollie | South | 45 | 4 |
| 6 | Cara | North | 85 | 2 |
| 7 | Dev | South | 58 | 2 |
| 8 | Finn | North | 82 | 3 |
| 9 | Ben | South | 63 | 1 |
Ties work the same way as RANK: two people on the same score in a region share a place. There's more on COUNTIFS in COUNTIF and COUNTIFS.
Common mistakes
Lots of people ranked 1st
The list wasn't locked, so it slid down as the formula was copied. By the bottom row, each score is only compared with the few below it. Use $B$2:$B$13: press F4 on the range (on a Mac, Cmd+T).
The order is upside down
A 1 on the end of RANK means smallest first. Leave it off (or use 0) for biggest first.
The same name twice in a top 5
Two people share a score, and MATCH finds the first one both times. Use the TAKE and SORT way in Excel 365, or add a tie-break column and use LARGE on that.
Some scores aren't ranked
RANK gives #N/A for a score stored as text, and LARGE skips it. See numbers stored as text.
Try it now
In D2, give each employee's rank, with 1 for the highest score. Your formula will be copied down to D13.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Employee | Region | Score | Rank |
| 2 | Grace | North | 67 | |
| 3 | Tom | South | 54 | |
| 4 | Priya | East | 88 | |
| 5 | Marek | West | 72 | |
| 6 | Nia | North | 91 | |
| 7 | Ollie | South | 45 | |
| 8 | Amira | East | 79 | |
| 9 | Ben | West | 63 | |
| 10 | Cara | North | 85 | |
| 11 | Dev | South | 58 | |
| 12 | Ewa | East | 70 | |
| 13 | Finn | West | 82 |
Open this in Try a formula: the same sheet with the answer filled in, to change or share by link.
Part of Excel data analysis practice: every lesson on the topic, with a project in Excel.
Where it works
RANK, LARGE and SMALL work in every version of Excel, on Windows and Mac, and in Excel for the web. RANK.EQ and RANK.AVG need Excel 2010 or later. SORT needs Excel 2021 or later, and TAKE needs Excel 365 or Excel 2024.
Questions
How do I rank in Excel without duplicate ranks?
Add a tie-break that counts how many times the score has come up so far: =RANK(B2,$B$2:$B$50)+COUNTIF($B$2:B2,B2)-1. Only the start of the COUNTIF range is locked, so it grows as you copy down. The first person on a tied score keeps the place and the next one moves down one. If the tie should go by something else, such as the earlier finish time, sort the list by that first.
How do I rank from lowest to highest in Excel?
Add a 1 as the last part of RANK: =RANK(B2,$B$2:$B$50,1). The smallest number is then 1st, which suits race times, costs or days absent. Leave the last part off, or put 0, to give the biggest number 1st. For the lowest values themselves, use SMALL: =SMALL($B$2:$B$50,1) is the lowest and 2 gives the second lowest.
How do I show the names of the top 5 as well as the scores?
Find each score with LARGE, then look up the name with INDEX and MATCH: =INDEX($A$2:$A$50,MATCH(E2,$B$2:$B$50,0)). This shows the first name twice when two people tie, because MATCH stops at the first match. In Excel 365 or 2024, =TAKE(SORT(A2:B50,2,-1),5) gives the top 5 names and scores together, with each tied person shown.
How do I rank within a group in Excel?
Count how many rows in the same group have a higher score, then add 1: =COUNTIFS($B$2:$B$50,B2,$C$2:$C$50,">"&C2)+1, where column B holds the group and column C the score. The top of each group gets 1. Ties share a place, as with RANK. For lowest first, use "<" in place of ">".