RANK Function

Excel Functions › Compatibility

All versions (legacy) Compatibility

The Excel RANK function returns the rank of a number within a list of numbers. It is a legacy name — Microsoft now recommends RANK.EQ, which behaves identically (ties share the top rank).


Quick answer:
=RANK(5,{8,5,5,2,1}) 5 ranks 2nd in descending order = 2

Syntax

=RANK(number, ref, [order])
ArgumentDescription
numberRequiredThe value whose rank you want.
refRequiredThe array or range of numbers to rank against. Non-numeric values are ignored.
orderOptional0 or omitted = descending (largest ranks 1); any non-zero value = ascending (smallest ranks 1).

How to use it

RANK reports the position of a value within a list. By default the largest number is rank 1 (descending).

=RANK(5,{8,5,5,2,1}) // descending: 5 is 2nd = 2
=RANK(5,{8,5,5,2,1},1) // ascending: 5 ranks 3

Ties receive the same rank, and that rank equals the best (top) position of the tied group — so two values tied for 2nd both get rank 2, and the next value is rank 4 (3 is skipped).

Use the modern names: RANK.EQ reproduces RANK exactly (ties share the top rank), while RANK.AVG gives tied values the average of their positions. Prefer one of these in new workbooks.

Try it: interactive demo

Live demo

Pick a RANK example to see the formula and its result.

Result:

Practice workbook

📊
Download the free RANK practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

Is RANK the same as RANK.EQ?
Yes — RANK.EQ (Excel 2010+) uses the same tie-handling (tied values share the top rank) and returns identical results. RANK.AVG is a newer alternative that averages tied positions.
How are ties handled?
Tied numbers get the same rank, equal to the highest position in the tie. The next distinct value skips the intervening rank(s).
How do I rank smallest-to-largest?
Set the optional order argument to a non-zero value (e.g. 1). Then the smallest number ranks 1.
Should I switch to RANK.EQ?
For new work, yes — it is the supported name. Use RANK.AVG only if you want tied values to receive their averaged rank.

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: RANK.EQ · RANK.AVG · LARGE · SMALL · PERCENTRANK.INC