Statistical function

RANK.EQ function

Returns the rank of a number in a list, such as a rep's place in a sales league; ties share the highest rank.

Available in Excel 2010 and later, Microsoft 365, Excel for the web, Excel for Mac 2011 and later

Excel 2010 and laterWorks in Google Sheets

Syntax

RANK.EQ(number, ref, [order])
ArgumentWhat it means
numberRequiredThe value to rank.
refRequiredThe list of numbers to rank against. Text and empty cells are ignored.
orderOptional0 or omitted: descending, largest = 1 (sales, scores). Non-zero: ascending, smallest = 1 (times, costs).

Returns: A whole number rank; tied values get the same (best) rank and the next rank is skipped.

How RANK.EQ works

RANK.EQ tells you the position of a value within a list: 1st, 2nd, 3rd and so on. Use it for sales leaderboards, class rankings, product performance tables or supplier comparisons. By default the largest value is rank 1, which suits revenue or scores; for lap times, costs or response times where smaller is better, set order to 1.

Ties are handled the "competition" way: equal values get the same rank and the following rank is skipped, giving 1, 1, 3. This is the same behaviour as the older RANK function. If you prefer tied values to share the average position (1.5, 1.5, 3), use RANK.AVG. To break ties, add a COUNTIF on the rows above. Always lock the reference with dollar signs before copying down.

Examples

1Sales league table

C6fx=RANK.EQ(B6, $B$2:$B$7)
ABC
1RepSales
2Ana840
3Ben920
4Chloe760
5Dev920
6Eva8803
7Finn760

Result: 3

Eva's 880 is beaten only by the two 920s, so she is ranked 3. Ben and Dev both rank 1, and rank 2 is skipped.

2Fastest time ranks first

C3fx=RANK.EQ(B3, $B$2:$B$5, 1)
ABC
1DriverRoute time (min)
2Ana42
3Ben381
4Chloe45
5Dev40

Result: 1

With order 1 the smallest value is rank 1. Ben's 38 minutes is the quickest, rank 1.

3Break ties by order of appearance

C5fx=RANK.EQ(B5, $B$2:$B$7) + COUNTIF($B$2:B4, B5)
ABC
1RepSales
2Ana840
3Ben920
4Chloe760
5Dev9202
6Eva880
7Finn760

Result: 2

Dev ties with Ben at 920 (rank 1). COUNTIF counts how many earlier rows already hold 920 (one: Ben), so Dev becomes 2 and every rank is unique. Ben's row gives 1 + 0 = 1.

4Rank within a group

D2fx=COUNTIFS($A$2:$A$6, A2, $C$2:$C$6, ">"&C2) + 1
ABCD
1RegionRepSales
2NorthAna8402
3SouthBen920
4NorthChloe760
5SouthDev880
6NorthEva900

Result: 2

There is no RANKIFS, so count how many reps in the same region sold more, then add 1. Ana's 840 is beaten only by Eva's 900 in the North, so she ranks 2nd within her region.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 18 KB

Common errors and how to fix them

ErrorWhy it happensFix
#N/Anumber is not in ref (often a rounding or text-number mismatch).Rank values taken from the same list; convert text to numbers.
Ranks change when copyingref was not locked with $.Use an absolute reference such as $B$2:$B$7.

Tips

  • =SORTBY(A2:B7, B2:B7, -1) in Microsoft 365 builds a sorted leaderboard without any RANK columns.
  • RANK.EQ ignores text and blanks in ref, so a missing figure does not count as last place.

Questions

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

RANK and RANK.EQ are identical: ties share the best rank. RANK.AVG gives ties the average of their positions.

How do I rank without gaps after ties (1, 1, 2)?

That is a "dense" rank. In Microsoft 365: =XMATCH(B2, SORT(UNIQUE($B$2:$B$7),,-1)).

How do I rank from lowest to highest?

Set the third argument to 1: =RANK.EQ(B2, $B$2:$B$7, 1).

Google Sheets

RANK.EQ also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

RANK.EQ in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
DanishPLADS.LIGE
DutchRANG.GELIJK
FinnishARVON.MUKAAN.TASAN
FrenchEQUATION.RANG
GermanRANG.GLEICH
HungarianRANG.EGY
ItalianRANGO.UG
Norwegian (Bokmål)RANG.EKV
PolishPOZYCJA.NAJW
Portuguese (Brazil)ORDEM.EQ
Portuguese (Portugal)ORDEM.EQ
RussianРАНГ.РВ
SpanishJERARQUIA.EQV
SwedishRANG.EKV
TurkishRANK.EŞİT

Recipes that use RANK.EQ