In Excel: use =RANK.EQ(number, ref) — it returns the position of a value within a range, ranking largest first unless you pass a non-zero order argument.
On this page8
Syntax
Arguments
| Argument | required / optional | Description |
|---|---|---|
number | required | The value to find the rank of. |
ref | required | The range to rank within. Anchor it with $ before filling down. |
order | optional | 0 or omitted ranks largest first; any non-zero value ranks smallest first. |
Related functions
Select the first cell of the rank column and type =RANK.EQ(.
Click the value to rank, then a comma.
Select the full range and press F4 to anchor it with dollar signs.
Add a comma and 1 if smaller values should rank first, then press Enter and fill down.
Need it as an auditable file?
Ships inside the linked template — formula-driven, unlocked, audit-ready.
What this does
RANK.EQ returns a value's position within a set. Ties share the higher rank and then create a gap: two values tied at second both show 2 and the next is 4. RANK.AVG instead gives tied values the average of the positions they occupy. The legacy RANK still works and matches RANK.EQ. The single most common mistake is forgetting to anchor the reference range with dollar signs before filling the formula down, which makes every row rank against a different, shrinking window. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “use rank function in excel”. Start on a copy or a tiny sample, keep the affected formula visible, and compare the result with the tool above before you touch the real workbook. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. The point is a calculation you can defend to a CFO or an auditor, but the practical win is that someone else can open the file and understand what happened without asking you.
A worked example
Scores in B2:B50 ranked highest first: =RANK.EQ(B2, $B$2:$B$50) filled down. Ranking fastest-first on times, where lower is better: =RANK.EQ(B2, $B$2:$B$50, 1). To break ties by a secondary measure, add a tiny tiebreaker: =RANK.EQ(B2,$B$2:$B$50)+COUNTIF($B$2:B2, B2)-1. RANK turns a column of numbers into a league table that updates itself, without the sorting that would disturb the rest of the sheet. If there is any chance you will reuse this, drop it into a small template tab right now: a labelled input area on the left and the formula beside it, checked once against the tool above. Next time the same question comes up, the answer is a single paste away instead of a rebuild from memory.
In Google Sheets
If you are in Google Sheets rather than Excel, the good news is that the formula shown here is identical and the workflow barely changes — menus sit across the top instead of in a ribbon, and a few function names differ slightly, but anything you build here moves across with little or no rework. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. Here is the takeaway for “use rank function in excel”: copy the answer if you are busy, but if you have a spare few minutes, rebuild the example in Excel yourself with the tool above open beside it. That single pass — type it, run it, watch the result move when you change an input — is what turns a formula you found into a technique you trust. Keep your inputs labelled and referenced, never hard-coded, and the same sheet stays correct and auditable as it grows. Done that way, you will not need to look this up again, and you will be the person others ask.
Common mistakes
- Not anchoring the reference range, so filling down ranks each row against a different subset.
- Expecting sequential ranks with ties present — RANK.EQ leaves gaps after a tie by design.
- Ranking times or costs without the order argument, which puts the worst performer first.
Frequently asked questions
What is the difference between RANK.EQ and RANK.AVG?
RANK.EQ gives tied values the same, higher rank and then skips positions. RANK.AVG gives them the average of the positions they span.
How do I rank smallest to largest?
Pass a non-zero third argument: =RANK.EQ(B2, $B$2:$B$50, 1).
How do I break ties?
Add a COUNTIF over an expanding range: =RANK.EQ(B2,$B$2:$B$50)+COUNTIF($B$2:B2,B2)-1 gives each tied value a distinct rank.
Other ways people ask this
This is also commonly searched as “excel rank function”, “how to use the rank function in excel” and “excel function rank”. They describe the identical operation, so you are in the right place no matter how you phrased it.
Why do people search for this in so many different ways?
Because the same task has many names. “excel rank function”, “how to use the rank function in excel”, “excel function rank” all point at the one operation explained on this page, which is why they all lead here.