RANK Function in Excel: Rank Scores and Sales
By ExcelReady TeamUpdated 6 min read
The short answer
RANK.EQ returns a number's position in a list. Write =RANK.EQ(B2,$B$2:$B$8) to rank the value in B2 against the whole column, with the largest value ranked 1. Add a third argument of 1 to rank smallest first. Tied values share a rank and the next rank is skipped. RANK does the same job and still works in every version of Excel.
Key takeaways
- =RANK.EQ(number, ref, [order]) ranks largest = 1 by default; order 1 ranks smallest = 1.
- Lock the list with $ signs so the range stays fixed when you fill the formula down.
- Ties share the same rank and the next rank is skipped, so two 5ths are followed by a 7th.
- Add COUNTIF($B$2:B2,B2)-1 to give every tied value a unique rank.
- RANK gives positions; LARGE gives the value at a position; SORT builds the leaderboard.
On this page+
The RANK function in Excel tells you where each value stands in a list: 1st, 2nd, 3rd and so on. Today the main version is RANK.EQ, which ranks the largest value as 1 by default. This guide shows how to rank a sales team, how to rank smallest first, what happens with ties and how to break them, and how to turn ranks into a sorted leaderboard.
What does the RANK function do?#
RANK.EQ compares one number with a list and returns its position. It has three arguments:
=RANK.EQ(number, ref, [order])| Argument | Meaning | Example |
|---|---|---|
| number | The value to rank | B2 |
| ref | The full list to rank against | $B$2:$B$8 |
| order | Optional. 0 or left out = largest is 1; 1 = smallest is 1 | 1 |
There are three versions. RANK is the original and still works everywhere. RANK.EQ (Excel 2010 and later) gives the same results under a clearer name. RANK.AVG handles ties differently, as shown below.
The examples use this sales list in A1:B8:
| A | B | |
|---|---|---|
| 1 | Rep | Sales |
| 2 | Amira | 48,200 |
| 3 | Ben | 39,500 |
| 4 | Chloe | 52,750 |
| 5 | Dev | 39,500 |
| 6 | Elena | 61,300 |
| 7 | Farid | 44,100 |
| 8 | Grace | 35,800 |
How to rank values from highest to lowest#
Type the formula next to the first value, lock the list, and fill down.
- Click C2 and type
=RANK.EQ(B2,$B$2:$B$8). - Press Enter. Amira's rank is 3.
- Fill down to C8 (Windows: Ctrl+D; Mac: ⌘D).
The ranks are: Amira 3, Ben 5, Chloe 2, Dev 5, Elena 1, Farid 4, Grace 7.
The $ signs are the key detail. Without them, the list slides down one row each time you fill, and the last rows are ranked against a shrinking list. Press F4 (Windows) or ⌘T (Mac) after typing a range to add the dollar signs.
How to rank from lowest to highest#
Add 1 as the third argument when a smaller number is better, such as race times, costs or error counts.
=RANK.EQ(B2,$B$2:$B$8,1)On the sales data, Grace becomes rank 1 and Elena rank 7. Ben and Dev share rank 2, so no one is 3rd.
How RANK handles ties#
Tied values get the same rank, and the next rank is skipped. Ben and Dev both sold 39,500, so both are 5th, and Grace is 7th. Nobody is 6th.
RANK.AVG gives tied values the average of the ranks they cover instead:
| Rep | Sales | RANK.EQ | RANK.AVG |
|---|---|---|---|
| Ben | 39,500 | 5 | 5.5 |
| Dev | 39,500 | 5 | 5.5 |
| Grace | 35,800 | 7 | 7 |
Use RANK.EQ for leaderboards and competitions. RANK.AVG is mostly used in statistics. If you share files with people on Excel 2007 or older, use plain RANK: it behaves like RANK.EQ and opens everywhere. Newer Excel keeps RANK for compatibility, so old workbooks still calculate.
How to break ties and get unique ranks#
Add a COUNTIF that counts how many times the value has already appeared above, and subtract 1.
=RANK.EQ(B2,$B$2:$B$8)+COUNTIF($B$2:B2,B2)-1The trick is the half-locked range $B$2:B2. It grows as you fill down: B2:B2, then B2:B3, and so on. For Ben (row 3), the value 39,500 appears once so far, so he keeps rank 5. For Dev (row 5), it has appeared twice, so Dev gets 5 + 2 - 1 = 6. Every rank is now unique, which helps when you need to look people up by rank.
This rewards whoever is higher in the list. For a fairer tie-break, such as fewer sick days, rank on a second column instead.
RANK vs LARGE: position or value?#
RANK and LARGE answer opposite questions. RANK takes a value and returns its position. LARGE takes a position and returns the value.
| Question | Formula | Result |
|---|---|---|
| What rank is Chloe? | =RANK.EQ(B4,$B$2:$B$8) | 2 |
| What is the 2nd highest sale? | =LARGE($B$2:$B$8,2) | 52,750 |
| What is the lowest sale? | =SMALL($B$2:$B$8,1) | 35,800 |
Use LARGE and SMALL to build a top-3 list; use RANK to label every row. The lesson on LARGE and SMALL practises both, and the comparison of RANK vs LARGE goes deeper. To pull the names of the top performers, see how to build a top N list.
How to turn ranks into a sorted leaderboard#
In Excel 2021 or Microsoft 365, SORT can return the whole table ordered by sales, with no manual sorting.
=SORT(A2:C8,2,-1)This sorts A2:C8 by its 2nd column (Sales), largest first (-1). The result spills into as many rows as needed, so leave empty space below the formula. Elena comes first, then Chloe, Amira and so on, with each rank beside the name. The SORT function guide explains every argument, and the SORT lesson lets you try it.
To sort by rank and then by name, read how to sort by multiple columns. For a list of distinct values in order, see unique sorted lists, and for choosing between the two sorting functions, see SORT vs SORTBY.
Common RANK mistakes#
Check these if the ranks look wrong:
- No
$signs. The list shifts as you fill down. Lock it:$B$2:$B$8. - Wrong order. If the smallest value shows rank 1 by surprise, remove the 1 at the end.
- Numbers stored as text. Text values are ignored, and ranking one returns #N/A.
- Range too short. A value outside the list returns #N/A.
- Expecting no gaps after ties. RANK.EQ skips ranks after a tie; use the COUNTIF tie-breaker if you need 1 to 7 with no repeats.
Practise it#
Ranking questions are common in data analyst screening tests, often combined with LARGE or SORT. Practise LARGE and SMALL in a live spreadsheet: you type the formula and it checks it instantly. Then practise SORT to build a leaderboard, and try the data analyst Excel test when you're ready.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Where does Chloe rank by sales? Click C4 and use RANK.EQ to rank B4 against the locked list $B$2:$B$8, largest first.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Rank | |||
| 2 | ||||
| 3 | ||||
| 4 | ||||
| 5 | ||||
| 6 | ||||
| 7 | ||||
| 8 | ||||
| 9 | ||||
| 10 | ||||
| 11 |
Tip: The number to rank comes first, then the whole list with $ signs.
Practise this in a lesson
Frequently asked questions
How do I use the RANK function in Excel?
Type =RANK.EQ(B2,$B$2:$B$8) next to the first value and fill it down. The largest value gets rank 1. The $ signs keep the list the same for every row.
What is the difference between RANK, RANK.EQ and RANK.AVG?
RANK and RANK.EQ give the same result: tied values share the top rank of the tie. RANK.AVG gives tied values the average of their ranks, so two values tied for 5th both get 5.5.
How do I rank from lowest to highest in Excel?
Add 1 as the third argument: =RANK.EQ(B2,$B$2:$B$8,1). The smallest value then gets rank 1, which suits race times or costs.
How do I rank in Excel without duplicates?
Add a COUNTIF tie-breaker: =RANK.EQ(B2,$B$2:$B$8)+COUNTIF($B$2:B2,B2)-1. The first of two tied values keeps the rank and the second gets the next one.
Why does RANK return #N/A?
The number you are ranking isn't in the list, often because the range doesn't cover that row or the value is stored as text. Check the range and convert text to numbers.