Cellwise Try it free

Excel guide · 4 min read

How to rank numbers in Excel

Quick answerUse =RANK.EQ(C2,$C$2:$C$9) and fill it down: the biggest number gets rank 1. Add a third argument of 1 to rank the smallest first. The same result comes from =COUNTIF($C$2:$C$9,">"&C2)+1, which counts how many values beat this one and adds 1, and is easier to extend to ties and groups.

Sample data

Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.

ABC
1RepRegionSales
2PriyaEast48200
3MarcusWest51750
4ElenaEast39900
5TomEast51750
6AishaWest62300
7BenWest44100
8GraceEast57800
9LuisWest39900

Method 1: COUNTIF rank (highest = 1)

A rank is just "how many people beat me, plus one". COUNTIF counts the sales greater than this row, so the top seller gets 0 + 1 = 1. Put it in D2 and fill down to D9.

The dollar signs lock the range so it does not slide down as you fill. Without them, the last row would only compare itself against itself and every rep would look like a winner.

=COUNTIF($C$2:$C$9,">"&C3)+1

Result: 3

Marcus ranks 3rd: only Aisha (62,300) and Grace (57,800) sold more. Tom has the same 51,750, so he is also 3rd, and nobody gets 4th.

Method 2: RANK.EQ and RANK.AVG

Excel has built-in ranking functions, available since Excel 2010. =RANK.EQ(C2,$C$2:$C$9) works exactly like the COUNTIF formula above: tied values share the best rank and the next rank is skipped, so Marcus and Tom are both 3rd and Priya is 5th. The older RANK function does the same thing and still works for compatibility.

=RANK.AVG(C2,$C$2:$C$9) gives tied values the average of the ranks they cover. Marcus and Tom occupy places 3 and 4, so both get 3.5. Sports tables and many statistics methods expect this version.

The optional third argument sets the direction: leave it out (or use 0) for highest first, use 1 for lowest first. The second argument must be a real range on the sheet, not a typed list. Pick RANK.EQ when you just want a leaderboard; pick the COUNTIF version when you need extra conditions, because COUNTIFS can add them.

Rank the lowest value first

For delivery times, costs, golf scores or error counts, smaller is better. Flip the comparison to "<" so you count the values below this one. With RANK.EQ you would add 1 as the third argument instead.

=COUNTIF($C$2:$C$9,"<"&C4)+1

Result: 1

Elena gets rank 1 because nobody sold less than 39,900. Luis has the same amount, so he shares rank 1.

Average rank for ties (like RANK.AVG)

If you need the averaged tie rank in a formula you can build on, count the values above, then add the middle position of the tied block. COUNTIF($C$2:$C$9,C3) is the number of tied values, including this one.

=COUNTIF($C$2:$C$9,">"&C3)+(COUNTIF($C$2:$C$9,C3)+1)/2

Result: 3.5

3.5 for Marcus: two reps are above him, and he shares places 3 and 4 with Tom.

Break ties so every rank is unique

Bonus tables and "top 3" lookups often need ranks 1 to 8 with no repeats. Add a second COUNTIF over an expanding range ($C$2:C3, with only the start locked). It counts how many times this value has appeared so far, so the first of two tied reps gets the better rank.

This breaks ties by row order. If you want a fairer tie-break, such as fewer returns or an earlier close date, sort by that column first.

=COUNTIF($C$2:$C$9,">"&C5)+COUNTIF($C$2:C5,C5)

Result: 4

Tom gets 4: Marcus took 3rd because he appears higher in the list with the same 51,750.

Rank within each region

RANK.EQ cannot filter by group, but COUNTIFS can. Add a condition that the region matches this row, so each rep is only compared with their own region.

=COUNTIFS($B$2:$B$9,B5,$C$2:$C$9,">"&C5)+1

Result: 2

Tom is 2nd in East: only Grace (57,800) sold more there. In the company-wide ranking he is 3rd.

Common mistakes

Forgetting the $ signs in the range

C2:C9 becomes C3:C10, C4:C11 and so on as you fill down, so lower rows rank against fewer values. Lock it as $C$2:$C$9 (press F4 after selecting the range).

Numbers stored as text

COUNTIF and RANK.EQ skip text, so a value imported as "51750" is not counted and gets a wrong rank. Convert the column to real numbers first.

Expecting ranks to change when you sort

A rank formula does not sort anything. Sort the table by the rank column (Data > Sort), or in Excel 365 build a sorted copy with =SORT(A2:C9,3,-1).

Ranking blank rows

A rep with no sales yet would still get a rank. Wrap it: =IF(C2="","",COUNTIF($C$2:$C$9,">"&C2)+1).

FAQ

What is the difference between RANK, RANK.EQ and RANK.AVG?

RANK and RANK.EQ are the same: ties share the best rank and the next rank is skipped. RANK.AVG gives ties the average of the places they take, such as 3.5 for a two-way tie for 3rd.

How do I rank from lowest to highest in Excel?

Use 1 as the third argument: =RANK.EQ(C2,$C$2:$C$9,1). With COUNTIF, count the smaller values instead: =COUNTIF($C$2:$C$9,"<"&C2)+1.

How do I rank without skipping numbers after a tie?

That is a dense rank (1, 2, 3, 3, 4). In Excel 365, =XMATCH(C2,SORT(UNIQUE($C$2:$C$9),,-1)) gives it: it finds the position of the value in the sorted list of distinct values.

How do I show the name of the top seller?

Find the highest value with LARGE and look up its name: =INDEX(A2:A9,MATCH(LARGE(C2:C9,1),C2:C9,0)) returns Aisha. Change the 1 to 2 or 3 for the next places.

Functions used

Related guides

Updated