RANK Formula in Excel: Rank Sales, Scores, and KPIs (with Examples)
Rank formula in Excel explained: use RANK, RANK.EQ, and RANK.AVG to rank sales, scores, and KPIs. Syntax, examples, ties, and fixes analysts need daily.
The rank formula in Excel answers one of the most common analyst questions: where does this row stand relative to everything else? Whether you are ranking sales reps by revenue, candidates by test score, or products by return rate, ranking turns a flat column of numbers into a leaderboard in a single fill-down. This guide builds on the Excel interface tour and pairs naturally with pivot table summaries when you need both the ranking and the aggregate view.
On the Data Analyst Roadmap, ranking sits in the Excel fundamentals block (weeks 5–6): it is the same ordering logic you will later express as RANK() in SQL window functions, so learning it here pays off twice.
Rank variants every analyst should know: RANK, RANK.EQ, RANK.AVG
RANK and RANK.EQ behave identically and preserve the classic competition ranking with skipped numbers. RANK.AVG averages tied positions instead, which keeps downstream averages and percentiles mathematically consistent.
Rank Formula in Excel: Syntax and How It Works
The syntax, per Microsoft Support: RANK, is:
=RANK(number, ref, [order])| Argument | Required | What it does |
|---|---|---|
number | Yes | The value whose rank you want (usually a cell like B2) |
ref | Yes | The range to rank against (for example $B$2:$B$100) |
[order] | No | 0 = descending, largest gets rank 1 (default); 1 = ascending, smallest gets rank 1 |
Modern Excel splits this into two explicit functions: RANK.EQ (identical to RANK) and RANK.AVG (averages ties). You will see all three in the wild, so recognise them:
=RANK.EQ(B2, $B$2:$B$100, 0)=RANK.AVG(B2, $B$2:$B$100, 0)Three rules govern everything else. First, ref is almost always an absolute reference ($B$2:$B$100) — without the $ locks the range slides down as you fill and each row gets ranked against a different window. Second, text and logical values inside ref are ignored, so a stray "N/A" string does not break the ranking but also does not get ranked. Third, duplicate values receive the same rank, and by default the next rank is skipped: values ranked 1, 2, 2 push the following value to 4, not 3. That skip surprises people every week, so decide up front whether your stakeholder expects competition ranking (1, 2, 2, 4) or dense ranking (1, 2, 2, 3).
Step-by-Step Example: Ranking a Sales Team
Take a regional sales table. Ten reps, one month of revenue in column B, and you need a leaderboard column C:
| Rep | Revenue | Formula in C2 (filled down) |
|---|---|---|
| Meera | 482000 | =RANK(B2, $B$2:$B$11, 0) |
| Arjun | 517000 | =RANK(B3, $B$2:$B$11, 0) |
| Kabir | 517000 | =RANK(B4, $B$2:$B$11, 0) |
| Divya | 390000 | =RANK(B5, $B$2:$B$11, 0) |
| Rohan | 445000 | =RANK(B6, $B$2:$B$11, 0) |
Step 1 — write the formula once in C2:
=RANK(B2, $B$2:$B$11, 0)This asks: where does 482000 stand among all ten revenues, largest first? The answer is 3, because two reps beat Meera.
Step 2 — double-click the fill handle to copy down. Because B2 is relative it becomes B3, B4, and so on, while $B$2:$B$11 stays frozen. This is the relative-versus-absolute pattern from cell references doing its most visible work.
Step 3 — read the ties. Arjun and Kabir both sold 517000, so both get rank 1, and Meera drops to rank 3 — there is no rank 2. If the sales head wants an unbroken 1-to-10 leaderboard for payout slabs, switch to dense ranking:
=RANK(B2, $B$2:$B$11, 0) + COUNTIF($B$2:B2, B2) - 1The COUNTIF($B$2:B2, B2) counts how many times the current value has appeared so far (1 for the first occurrence, 2 for the second), so the first of a tied pair keeps its rank and the second moves exactly one step down. Note the mixed reference $B$2:B2: locked start, moving end — it expands as you fill down.
Step 4 — flip the order when smallest-is-best. For average handling time or defect count, rank ascending:
=RANK(B2, $B$2:$B$11, 1)Now the lowest value gets rank 1. A frequent production bug is reusing a descending-rank template on a smallest-wins metric, so name the column explicitly (Rank_LargestFirst or similar) when both directions live in one workbook.
Common Mistakes and Fixes
The drifting range: filling down without $ locks
=RANK(B2, B2:B11, 0) looks right in row 2. Fill it to row 11 and the last row evaluates =RANK(B11, B11:B20, 0) — ranking one value against mostly empty cells, which returns 1 for nearly everyone. The leaderboard looks plausible and is completely wrong. Always lock the range: $B$2:$B$11.
The second classic mistake is ranking against a range that includes the total row. If B12 holds =SUM(B2:B11), it is larger than every rep and steals rank 1 while pushing everyone else down. Keep totals outside the ref range, or point ref at the data rows only.
Ties breaking a payout or cutoff silently
When rank 3 straddles a bonus cutoff and two reps tie at rank 3, competition ranking gives both the bonus and skips rank 4 — finance sees an unexpected extra payout. Decide the tie policy before publishing: share the slab (both get rank-3 bonus), use RANK.AVG for fractional fairness, or add a documented tiebreaker column such as revenue first, then deals closed.
A third pitfall: RANK ignores text but errors on error values. One #DIV/0! inside ref propagates into every rank in the column. Clean the input range first — the data cleaning guide covers the IFERROR patterns that fix this at the source.
Rank Formula in Excel vs Other Ordering Methods
Ranking is one of four ways to order data, and picking the wrong one creates brittle reports:
| Feature / Criteria |
|---|
Use the rank formula in Excel when the row order must stay stable (a rep roster, a product master) and the rank itself is consumed downstream — a bonus IF(C2<=3, ...), a conditional-format rule, or a review cutoff. Use Sort when a human reads the sheet top-to-bottom once. Use LARGE when you need the value at a position (=LARGE($B$2:$B$11, 3) returns the third-highest revenue) rather than each row's position. And when the ranking must respect filters, reach for the SUBTOTAL approach instead.
When to Use the Rank Formula in Excel in Analyst Work
Sales and performance leaderboards. The canonical case: rank reps, stores, or campaigns, then drive bonuses,-uplift callouts, and conditional formatting off the rank column rather than eyeballing sorted values. Because the formula survives inserts and refreshes, the Monday report updates itself when new rows paste in.
Cutoff and shortlist analysis. Rank test scores, vendor bids, or loan applications, then filter Rank <= N. This is cleaner than sorting and taking the top rows because the underlying order is preserved for audit — the query ran, but is the answer right? With RANK, the reviewer can verify any single row independently.
Percentile and banding inputs. Feed the rank into =C2/COUNT($B$2:$B$11) for a percentile, or bucket ranks into quartiles for the conditional formatting guide heatmap treatment. The same mental model transfers directly to RANK() OVER (...) in SQL — see SQL ROW_NUMBER vs RANK — which is exactly why this formula earns its place early on the analyst roadmap.
Related Excel Tutorials
- Excel Formulas: The Complete Guide
- XLOOKUP Formula in Excel
- SUM Formula in Excel
- Excel Pivot Tables Guide
- Explore All Guides in the Excel Tutorials Hub
Master Excel for Data Analysis
Learn Excel formulas, pivot tables, and dashboards with free, project-based courses.
Start Free Excel CourseFrequently Asked Questions
What is the rank formula in Excel?
The rank formula in Excel is =RANK(number, ref, [order]). It returns the position of a number within a list of numbers, so =RANK(B2, $B$2:$B$100, 0) tells you where the value in B2 stands among B2:B100, with 0 ranking largest first.
What is the difference between RANK, RANK.EQ, and RANK.AVG in Excel?
RANK and RANK.EQ are identical: tied values get the same rank and the next rank is skipped (1, 2, 2, 4). RANK.AVG gives tied values the average of the ranks they occupy (1, 2.5, 2.5, 4). Use RANK.AVG when the ranking feeds a statistical calculation.
Why does my RANK formula return the wrong order?
Almost always the order argument or the reference locking. Omit order (or use 0) for largest-first ranking such as sales; use 1 for smallest-first such as race times. And lock the range with $ (for example $B$2:$B$100) so the reference does not drift when you fill down.
How do I rank in Excel without skipping numbers after ties?
Combine RANK with COUNTIF: =RANK(B2, $B$2:$B$100, 0) + COUNTIF($B$2:B2, B2) - 1. This produces a dense sequence (1, 2, 2, 3) by adding the occurrence count of each value above the current row, so tied values still consume only one rank step.
Does the rank formula in Excel work with filtered data?
No — RANK evaluates the full range including hidden and filtered-out rows. For rankings that respect filters, use =SUBTOTAL(103, ...) helper logic or an AGGREGATE-based approach instead, as covered in our SUBTOTAL guide.

Written by
Founder at Topfolio with 6+ years in data & analytics across JPMC, Ultrahuman, and high-growth startups. Sat on hiring panels, reviewed 500+ resumes, and writes practical SQL & data guides.
Related Articles
Basic Excel Formulas: The Top 10 Formulas Every Analyst Needs to Know
Learn essential basic excel formulas: master SUM, AVERAGE, COUNT, IF, VLOOKUP, and conditional functions with syntax, examples, and practical fixes.
Compound Interest Formula in Excel: FV, Growth, and SIP Examples
Compound interest formula Excel guide: grow savings faster with =FV(rate, nper, pmt), the power-operator method, SIP math, and yearly compounding examples.
Excel Formula List: The Top 30 Functions Every Analyst Uses (with Examples)
The complete excel formula list for data analysts: 30 essential functions across Lookups, Math, Logical, Text, and Date categories with syntax and examples.