RANK Function: Rank Scores, Sales & Performance Metrics

RANK Formula in Excel Blogpost Feature Image
Learn how to use RANK.EQ and RANK.AVG in Excel to rank scores, sales, and performance data. Covers tie handling, ascending rank, unique ranks, and conditional group ranking.

Sorting a column to find rank positions destroys the original order and produces a static result. Every time data changes, you need to sort again. The RANK.EQ function solves this — it calculates each value's position in a list without moving anything. Update a single cell, and every rank in the column refreshes automatically. Furthermore, RANK.EQ handles both ascending and descending order, making it equally useful for test scores, race times, and sales figures.

Excel provides three ranking functions: RANK, RANK.EQ, and RANK.AVG. They share the same syntax. However, their tie-handling behaviour differs, and Microsoft recommends using RANK.EQ or RANK.AVG in new files rather than the older RANK function.

Availability: RANK works in every Excel version from Excel 2000 onwards. RANK.EQ and RANK.AVG require Excel 2010 or later, including Microsoft 365, Excel 2024, 2021, and 2019.

What Is the Syntax for RANK.EQ, RANK.AVG, and RANK?

All three functions share identical syntax. Only the name and tie-handling logic differ.

=RANK.EQ(number, ref, [order]) =RANK.AVG(number, ref, [order]) =RANK (number, ref, [order]) ← legacy, prefer RANK.EQ in new files
ArgumentRequired?What it does
numberRequiredThe value whose rank you want. Usually a cell reference pointing to one number in the list.
refRequiredThe full list of numbers to rank against. Always lock this with $ signs so it does not shift when the formula is copied down the column.
orderOptional0 (or omitted) = descending, largest value ranked 1st. Use this for scores and sales. 1 = ascending, smallest value ranked 1st. Use this for race times and error counts.

How Do RANK.EQ, RANK.AVG, and RANK Differ?

The only meaningful difference is how tied values are handled. RANK.EQ assigns both duplicates the same rank and skips the next position. RANK.AVG, by contrast, averages the positions they would have occupied. The original RANK function behaves identically to RANK.EQ.

FeatureRANK.EQRANK.AVGRANK (legacy)
Tie handlingSame rank, next position skippedAverage of the tied positionsSame as RANK.EQ
Tie result example (2nd and 3rd tie)Both get rank 2; rank 3 is skippedBoth get rank 2.5Both get rank 2; rank 3 is skipped
Result typeAlways an integerCan be a decimal (e.g. 2.5)Always an integer
Recommended?✅ Yes — use in new files✅ Yes — use when averages needed⚠ Legacy — may be deprecated
Available fromExcel 2010+Excel 2010+Excel 2000+
Always lock the ref argument with $ signs: Without $ signs, the reference shifts when you copy the formula down. As a result, each row compares against a different range instead of the full dataset. Use $B$2:$B$100 rather than B2:B100.

Example 1: Rank Scores — Highest Gets Rank 1

Descending rank is the default. It assigns rank 1 to the largest value. This suits exam scores, revenue figures, and any metric where higher is better. Leave the order argument blank or set it to 0.

1
Rank five test scores — highest score earns rank 1
A — Name
B — Score
C — RANK.EQ
D — RANK.AVG
Notes
James
94
1
1
🥇 Top
Sarah
88
2
2.5
Tied with Priya
Priya
88
2
2.5
Tied with Sarah
Marcus
75
4 (3 skipped)
4
After two 2nd-places
Ellen
61
5
5
Lowest
RANK.EQ — largest score gets rank 1 (order omitted = descending): Lock the ref range with $ so it stays fixed when copied down. =RANK.EQ(B2, $B$2:$B$6) → 1 for James (94) =RANK.EQ(B2, $B$2:$B$6, 0) → same as above (0 = descending) RANK.AVG — assigns 2.5 to both tied scores instead of 2 each: =RANK.AVG(B2, $B$2:$B$6) Key difference for tied values (scores of 88): RANK.EQ → both get 2; rank 3 is skipped entirely RANK.AVG → both get 2.5; no rank is skipped
RANK.EQ is better for leaderboards where you want clean integer positions. RANK.AVG is better for statistical analysis — for example, comparing rankings across groups where gaps in the sequence would distort correlation calculations.

Example 2: Ascending Rank for Race Times and Error Counts

For some metrics, a smaller value is better. A faster race time should earn rank 1. Fewer defects should earn the top position. Setting the order argument to 1 switches RANK.EQ to ascending mode — the smallest value gets rank 1.

2
Rank athletes by race time — fastest (lowest) time earns rank 1
A — Athlete
B — Time (sec)
C — Rank (asc)
D — Rank (desc)
Bolt
9.58
1 🥇
6
Blake
9.69
2 🥈
5
Gay
9.69
2 (tied)
5 (tied)
Powell
9.72
4 (3 skipped)
4
Ascending rank — smallest value gets rank 1. Use this for times, costs, error rates, and any metric where lower is better. =RANK.EQ(B2, $B$2:$B$7, 1) → 1 for Bolt (9.58 seconds) Descending rank (order=0 or omitted) for comparison: Gives the WRONG result for times — fast times would rank last. =RANK.EQ(B2, $B$2:$B$7, 0) → 6 for Bolt (incorrectly ranked last!) Additional examples where ascending order (1) is correct: - Support ticket resolution times (faster = rank 1) - Defect counts per team (fewer = rank 1) - Marathon times (shorter = rank 1) - Cost per unit (lower = rank 1)
A simple memory rule: Ask "Is bigger better?" If yes, use order 0 (descending). If no — as with times and costs — use order 1 (ascending). Getting the order wrong produces results that are completely reversed, so it is worth double-checking before copying the formula down.

Example 3: Break Ties and Assign Unique Ranks

RANK.EQ assigns the same rank to tied values and skips the next position. Sometimes, however, you need every row to have a unique rank — for instance, when generating a numbered leaderboard where no two entries can share the same position. Adding COUNTIF to the formula resolves ties by position in the list.

How the Tie-Break Formula Works

COUNTIF counts how many earlier rows hold the same value. Adding that count to the base RANK.EQ result pushes duplicate entries down by one position each. As a result, the first occurrence keeps the tied rank, and each subsequent duplicate receives the next available position.

3
Force unique ranks — no two rows share the same position
A — Name
B — Score
C — RANK.EQ
D — Unique rank
COUNTIF adds
James
94
1
1
+0
Sarah
88
2
2
+0 (first 88)
Priya
88
2
3
+1 (second 88)
Marcus
75
4
4
+0
Unique rank — add COUNTIF to push duplicates down by position. $B$2:B2 expands as the formula copies down (note the mixed reference). COUNTIF($B$2:B2, B2) counts how many times this value appeared so far. Subtract 1 so the first occurrence stays at its natural rank. =RANK.EQ(B2, $B$2:$B$100) + COUNTIF($B$2:B2, B2) - 1 Ascending version — unique rank for times (smallest = rank 1): Use COUNTIF with ">" to count larger values above the current row. =RANK.EQ(B2, $B$2:$B$100, 1) + COUNTIF($B$2:B2, B2) - 1

Example 4: Conditional Rank Within a Group

Standard RANK.EQ ranks across the entire dataset. Often, however, you need to rank within a category — for instance, the top salesperson per region, or the highest score per class. Replacing the ref argument with a filtered array achieves this cleanly.

4
Rank sales reps within their own region — conditional ranking
Column A = Region, Column B = Sales. Rank each rep only against others in the same region. Method 1 — COUNTIF approach (works in all Excel versions): Counts how many reps in the same region have a higher sales figure, then adds 1. =COUNTIF($A$2:$A$100, A2) ← not the full formula — see below =COUNTIFS($A$2:$A$100, A2, $B$2:$B$100, ">"&B2) + 1 COUNTIFS counts reps in the same region with HIGHER sales; +1 gives the rank position. Method 2 — RANK.EQ with IF (array formula, Ctrl+Shift+Enter in older Excel): IF filters the ref to only the matching region rows; FALSE values are ignored by RANK.EQ. =RANK.EQ(B2, IF($A$2:$A$100=A2, $B$2:$B$100)) Method 3 — Excel 365 only, using FILTER (no array entry needed): FILTER extracts the region's sales values; RANK.EQ ranks within that clean array. =RANK.EQ(B2, FILTER($B$2:$B$100, $A$2:$A$100=A2))
The COUNTIFS method is the most compatible — it works in Excel 2007 and later without array entry. Use RANK.EQ + FILTER in Excel 365 for the cleanest formula. Both approaches give the same result: each row's rank position within its own category.

Example 5: Display Rank as a Label — "1st", "2nd", "3rd"

Numbers alone can look bare in a report. Combining RANK.EQ with a SWITCH or nested IF that appends "st", "nd", "rd", or "th" converts rank integers into proper ordinals. Additionally, a CHOOSE function handles the first three suffixes concisely.

5
Format rank numbers as ordinal labels — "1st", "2nd", "3rd", "4th"
First, calculate the rank and store it in a helper column (or calculate inline). Then wrap in text to create ordinal labels. Method 1 — SWITCH for ordinal suffix (handles 1st–3rd cleanly): =SWITCH(=RANK.EQ(B2, $B$2:$B$20), 1, "1st", 2, "2nd", 3, "3rd", =RANK.EQ(B2, $B$2:$B$20) & "th") Method 2 — fully dynamic ordinal for any rank number: MOD(rank, 10) gives the last digit; exceptions for 11th, 12th, 13th. =LET( r, =RANK.EQ(B2, $B$2:$B$100), sfx, IF(AND(MOD(r,100)>=11, MOD(r,100)<=13), "th", SWITCH(MOD(r,10), 1,"st", 2,"nd", 3,"rd", "th")), r & sfx ) Result: "1st", "2nd", "3rd", "4th", ..., "11th", "12th", "13th", "21st"
LET is available in Excel 365 and Excel 2021: In older versions, skip LET and calculate the rank directly inside SWITCH or IF. For instance: =RANK.EQ(B2,$B$2:$B$20)&IF(RANK.EQ(B2,$B$2:$B$20)=1,"st",IF(RANK.EQ(B2,$B$2:$B$20)=2,"nd","th")).

Example 6: Rank with a Tiebreaker Column

When two rows share the same primary value, a secondary column can break the tie fairly. For example, two students with the same subject score might be ranked by their overall average. Two athletes with the same primary time might be separated by a secondary heat result. COUNTIFS handles multi-column tie-breaking cleanly.

6
Break ties using a second column — rank by subject score, resolve by overall average
Column B = Subject score (primary ranking criterion). Column C = Overall average (tiebreaker — higher average wins). Step 1: Start with the base rank for the subject score: =RANK.EQ(B2, $B$2:$B$100) Step 2: For ties — count others with the SAME subject score AND a HIGHER average. These other students rank above the current row within the tie group. =COUNTIFS($B$2:$B$100, B2, $C$2:$C$100, ">"&C2) Combined tiebreaker formula — base rank + adjustment for ties: Adds the number of tied peers who have a better overall average. =RANK.EQ(B2, $B$2:$B$100) + COUNTIFS($B$2:$B$100, B2, $C$2:$C$100, ">"&C2) Result: unique rank for every row. Peers with the same score and higher overall averages push this row down. Peers with lower averages leave this row's rank unchanged.
This two-column approach produces unique ranks for every row without sorting the data. Add more COUNTIFS terms for additional tiebreaker columns — for instance, a third column could break remaining ties by alphabetical name order.

How to Fix Common RANK Errors

Ranks shift when the formula is copied down

The ref argument is not locked with $ signs. Without them, the range shifts row by row as the formula copies. Each row then ranks against a different slice of the data. Fix this by using absolute references: replace B2:B100 with $B$2:$B$100.

#VALUE! error

RANK functions only work with numeric values. Text, blanks, and logical values in the ref range are ignored — but if the number argument itself is text, #VALUE! appears. Check whether the cell being ranked contains a number stored as text. Use ISNUMBER to verify, and VALUE() to convert if needed.

Wrong rank direction

The order argument is set incorrectly. For scores and revenue (higher is better), use 0 or omit the argument entirely. For times and error counts (lower is better), use 1. Specifically, a common mistake is using the default (descending) for a race time dataset — consequently, the fastest runner ends up ranked last.

Use RANK.EQ in new files, not RANK: Microsoft lists RANK under "Compatibility Functions" and may remove it in a future version. RANK.EQ produces identical results and is already the recommended replacement. Additionally, Excel shows a yellow warning triangle when RANK is used in newer workbooks.

Frequently Asked Questions

  • What is the difference between RANK.EQ and RANK.AVG?+
    Both functions rank values in a list, but they handle ties differently. RANK.EQ assigns the same integer rank to all tied values — for example, two values tied for 2nd both receive rank 2, and rank 3 is skipped. RANK.AVG, by contrast, averages the tied positions — both values receive rank 2.5, and no position is skipped. Use RANK.EQ for leaderboards and use RANK.AVG when performing statistical calculations that require continuous rank values.
  • Why does my RANK formula give the wrong result when copied down?+
    The most common cause is a relative reference in the ref argument. When you copy =RANK.EQ(B2, B2:B100) down, the ref shifts to B3:B101, B4:B102, and so on — each row compares against a different range. Fix this by locking the ref with $ signs: =RANK.EQ(B2, $B$2:$B$100). The $ prevents the range from shifting while the number argument (B2) correctly updates to B3, B4, and so on.
  • How do I rank within a category or group?+
    Replace the standard ref argument with a conditional array. The COUNTIFS method works in all versions: =COUNTIFS($A$2:$A$100, A2, $B$2:$B$100, ">"&B2)+1. This counts how many rows in the same group have a higher value and adds 1 for the rank. In Excel 365, alternatively use FILTER: =RANK.EQ(B2, FILTER($B$2:$B$100, $A$2:$A$100=A2)).

More Questions About RANK Functions

  • How do I force unique ranks with no ties?+
    Add COUNTIF with an expanding range to push duplicates down: =RANK.EQ(B2, $B$2:$B$100) + COUNTIF($B$2:B2, B2) - 1. The $B$2:B2 range starts fixed at the top but expands as the formula copies down. For each row, COUNTIF counts how many times that value appeared above it. Subtracting 1 ensures the first occurrence keeps its natural rank. Subsequent duplicates receive the next available positions.
  • What is the order argument in RANK.EQ?+
    The order argument controls rank direction. Use 0 (or omit it) for descending order, where the largest value gets rank 1 — this suits scores, sales, and revenue. Use 1 for ascending order, where the smallest value gets rank 1 — this suits race times, costs, and error counts. Getting the direction wrong produces rankings that are completely reversed, so it is worth double-checking against your specific use case.
  • Which Excel versions support RANK.EQ and RANK.AVG?+
    RANK.EQ and RANK.AVG are available in Excel 2010 and later, including Microsoft 365, Excel 2024, 2021, 2019, and 2016. The older RANK function works in every version from Excel 2000 onwards, but Microsoft may discontinue it in a future release. For new files, RANK.EQ is the recommended choice — it produces the same results as RANK while aligning with Microsoft's current function guidelines.