Last updated on November 3rd, 2026 at 04:28 pm
The rank formula in Excel shows where a number stands within a list. Use =RANK.EQ(B2,$B$2:$B$6,0) to give the highest value rank 1. In contrast, change the last argument to 1 when the lowest value should rank first. However, equal values share a rank.

Rank formula in Excel: syntax and arguments
=RANK.EQ(number,ref,[order])
- number: the cell containing the value to rank.
- ref: the comparison range.
- order: use 0 or omit it for highest first; use 1 for lowest first.
For example, Excel still supports RANK for compatibility. For a new workbook, choose RANK.EQ for shared competition ranks or RANK.AVG for average tied ranks. Also, you do not need to sort the source data first.
Rank formula in Excel: worked assessment example
This fictional example uses five candidates. First, enter the names in A2:A6 and the numeric scores in B2:B6.
| Row | Candidate | Score | RANK.EQ highest first | RANK.EQ lowest first | RANK.AVG highest first |
|---|---|---|---|---|---|
| 2 | Asha | 92 | 1 | 5 | 1 |
| 3 | Bilal | 85 | 2 | 3 | 2.5 |
| 4 | Charu | 85 | 2 | 3 | 2.5 |
| 5 | Dev | 76 | 4 | 2 | 4 |
| 6 | Esha | 64 | 5 | 1 | 5 |
Here, the rank formula in Excel gives both scores of 85 the same place. Therefore, compare the two tie methods before you choose an output.
Step 1: rank formula in Excel, highest to lowest
Next, enter =RANK.EQ(B2,$B$2:$B$6,0) in C2, then fill down to C6. As a result, the dollar signs keep the comparison range fixed while B2 changes to B3, B4 and so on.
Step 2: rank lowest to highest
Next, enter =RANK.EQ(B2,$B$2:$B$6,1) in D2 and fill down. As a result, this rank formula in Excel puts the score of 64 in first place. For example, in another dataset, this direction can rank costs or completion times where a smaller number is preferable.
Step 3: compare average tied ranks
Next, enter =RANK.AVG(B2,$B$2:$B$6,0) in E2 and fill down. Here, the two scores of 85 occupy positions 2 and 3, so both receive their average: (2 + 3) / 2 = 2.5.
Why does RANK.EQ skip a number after a tie?
In this example, two scores share second place, so the next score ranks fourth. Therefore, the sequence 1, 2, 2, 4, 5 is expected behaviour. This result does not mean the rank formula in Excel failed.
If you need unique numbers, first decide how you intend to break ties. For example, a secondary measured criterion is often more meaningful than row order. However, do not silently treat the first listed candidate as the better performer.
Unique ranks using order of appearance
To extend the rank formula in Excel with row order as the explicit tie-break rule, use =RANK.EQ(B2,$B$2:$B$6,0)+COUNTIF($B$2:B2,B2)-1 and fill down. As a result, the two scores of 85 receive 2 and 3. However, sorting the data can change which tied row receives which number. Therefore, document this limitation.
Common mistakes with the rank formula in Excel
| Problem | What to check |
|---|---|
| Results change unexpectedly after filling down | Lock the full comparison range with dollar signs. |
| The wrong end of the list ranks first | Check the order argument: 0 for highest, 1 for lowest. |
| A number is ignored or a result is unexpected | Check whether the cell stores a genuine number or text that looks numeric. |
| Tied scores have the same rank | That is the purpose of RANK.EQ. Choose RANK.AVG or an explicit tie-break rule only when needed. |
Questions about the rank formula in Excel
How do I find first, second and third position?
First, calculate ranks in a helper column and filter for ranks 1, 2 and 3. However, ties can produce more than three rows, and a rank may be skipped. Therefore, define how the result should handle ties before selecting a top-three list.
Can I rank percentages?
Yes. For example, the rank formula in Excel ranks the underlying numeric values, so you can rank percentages when you enter them as numbers. Also, keep the same unit and scale across the comparison range.
Can I use RANK instead of RANK.EQ?
For these basic examples, both versions of the rank formula in Excel return the same competition ranks. However, Excel retains RANK for compatibility. By comparison, RANK.EQ makes the handling of equal values explicit.
Finally, continue with the Advanced Excel syllabus or the separate LOOKUP function tutorial when you need to retrieve data rather than rank it.
Check the output before using it
First, test the formula on a small list where you know the answer. Then check one highest value, one lowest value and one tie. Finally, confirm that the result follows your chosen tie rule before you use it in a report.
Rank formula in Excel: choose the rule before the formula
A rank is a position, not a measure of how far apart two values are. For example, scores of 92 and 85 occupy first and second place in our case. The seven-mark gap matters to performance analysis, but the ranks alone do not show it. Therefore, report the original values alongside the positions.
| Your aim | Method | What a tie means |
|---|---|---|
| Give equal results equal competition ranks | RANK.EQ | 1, 2, 2, 4 |
| Assign the average of the occupied places | RANK.AVG | 1, 2.5, 2.5, 4 |
| Produce a unique position for every row | Use a stated secondary rule | A tie needs another criterion; the formula cannot invent fairness |
In a marksheet, shared ranks may be exactly what you need. In a report that needs five distinct rows, a tie-break may be useful. However, the purpose of the report must decide the rule. Do not change the ranking method simply because a skipped number looks untidy.
Rank within a group using COUNTIFS
Suppose each sales team needs its own leaderboard. A rank formula in Excel applied to the entire score column would compare everyone together. Instead, count how many people in the same team have a higher score, then add one.
Separate practice sheet: put names in column A, team names in B and scores in C. The first data row is row 2 and the last is row 7.
| Name | Team | Score | Expected team rank |
|---|---|---|---|
| Arun | Teal | 90 | 1 |
| Bina | Teal | 80 | 2 |
| Chirag | Teal | 80 | 2 |
| Diya | Navy | 95 | 1 |
| Evan | Navy | 90 | 2 |
| Farah | Navy | 70 | 3 |
In D2, enter =1+COUNTIFS($B$2:$B$7,B2,$C$2:$C$7,">"&C2) and fill down. The first pair of arguments restricts the count to the current team. The second counts scores above the current score. As a result, Bina and Chirag share second place within Teal.
To rank the lowest score first, change ">"&C2 to "<"&C2. Also, keep both criteria ranges the same size. This example assumes consistent team labels and numeric scores; tidy the data before you interpret the result.
How to break a tie using a second measured value
Now consider a separate assessment where the higher score wins. If scores tie, the shorter completion time wins. This is different from using whichever row happens to come first.
On a new sheet, put the five scores 92, 85, 85, 76 and 64 in B2:B6. Put completion times 12, 14, 11, 15 and 13 minutes in C2:C6. The expected positions are 1, 3, 2, 4 and 5: the candidate scoring 85 in 11 minutes outranks the candidate scoring 85 in 14 minutes.
Use =1+COUNTIF($B$2:$B$6,">"&B2)+COUNTIFS($B$2:$B$6,B2,$C$2:$C$6,"<"&C2). First, count everyone with a higher score. Then count equal-score candidates with a shorter time. Finally, add one to get the position.
However, candidates with equal scores and equal times still tie. That is appropriate unless the assessment has a further approved rule. Therefore, describe the rule in the report rather than call these “unique ranks” in every possible dataset.
Rank formula in Excel: errors that change the answer
Numbers stored as text
A cell can look like 85 while storing text. In that case, check the source and convert it to a genuine number where appropriate. Do not convert identifiers such as account numbers just because they contain digits. Ranking needs a measured numeric value, not every numeric-looking field.
Displayed rounding hides a real difference
Two percentages can both display as 10.0% but store 10.04% and 9.96%. Excel compares the stored values. If the agreed business rule ranks rounded values, create a clearly labelled helper column with =ROUND(B2,3) for percentage values rounded to one decimal place when displayed as percentages. For example, 0.1004 becomes 0.100. Then rank that helper range. Otherwise, retain the original precision.
Filters do not redefine the comparison range
Filtering a sheet does not make an ordinary RANK.EQ formula compare only visible rows. The formula still uses its referenced range. Therefore, define the population explicitly. If you need a team-only result, use the group method above rather than assume the filter changed the calculation.
The dataset grows but the range does not
If new records fall outside B2:B6, that original formula will not include them. Update the comparison range or use a well-designed Excel Table reference. Also check that a subtotal has not entered the ranked population. A total and an individual observation answer different questions.
Practice tasks for the rank formula in Excel
- Rank costs of ₹400, ₹250, ₹250 and ₹600, with the lowest first. Answer: 3, 1, 1, 4.
- Apply RANK.AVG to the same costs, lowest first. Answer: 3, 1.5, 1.5, 4.
- Add a new score of 95 to the five-candidate case. Answer: 95 ranks first; the previous highest score of 92 becomes second.
For each task, first state whether the highest or lowest value should win. Then explain what should happen to ties. This makes the rank formula in Excel easier to audit and the answer easier to defend.
Download the Excel ranking practice workbook
Download the RANK formula practice workbook (.xlsx). It contains descending ranks, ascending ranks, average tied ranks and a labelled row-order tie-break. The workbook starts data on row 5; the article’s first worked sheet starts on row 2. Use the references shown for the sheet you are working in.
Sources
Microsoft RANK.EQ documentation; Microsoft RANK.AVG documentation; Microsoft COUNTIFS documentation.
A CFA charterholder with hands-on experience across investment analysis and finance education. At MentorMeCareers, he writes and reviews content on CFA, financial modeling, and investment banking careers — grounded in real market data rather than generic advice, and shaped by what actually helps candidates and professionals succeed.

