Skip to content

RANK.AVG

Returns the rank of a number within a list, giving tied values the average of the ranks they share, such as 2.5.

Syntax

=RANK.AVG(, , )

Statistical

Excel 2010 and later, including Excel for Microsoft 365 and Excel for the web. There is no older equivalent.

Try it

Edit the formula in C3 or change the inputs. The sheet recalculates as you type.

C3
A
B
C
1
Student
Score
Rank
2
S1
90
3
S2
85
3.5
4
S3
85
5
S4
70
6
S5
95
7
8

C3 =RANK.AVG(B3,$B$2:$B$6) returns 3.5

How RANK.AVG works

RANK.AVG ranks a value within a list and handles ties fairly. Where RANK.EQ gives tied values the top rank of the group, RANK.AVG gives each of them the average of the ranks they occupy.

How ties are handled

Take quiz scores of 95, 90, 85, 85 and 70, ranked from the highest down. The two 85s share third and fourth place.

  • 95: RANK.EQ gives 1, RANK.AVG gives 1.
  • 90: RANK.EQ gives 2, RANK.AVG gives 2.
  • 85 (twice): RANK.EQ gives 3 to both, RANK.AVG gives 3.5 to both.
  • 70: RANK.EQ gives 5, RANK.AVG gives 5.

RANK.AVG gives both 85s a rank of 3.5, the average of 3 and 4. With no ties, RANK.AVG and RANK.EQ return the same whole numbers.

Why average ranks

Average ranks keep the ranks adding up. The ranks of five items always total 15, whether there are ties or not. That matters in rank-based statistics, such as Spearman's rank correlation and the Wilcoxon and Kruskal-Wallis tests, which all assume tied values get average ranks. For a league table, most people prefer RANK.EQ, because "joint 3rd" reads more naturally than "3.5th".

Arguments

  • number is the value to rank. It must appear in ref.
  • ref is the list. Lock it with $ when filling down, as in $B$2:$B$6. Text and blanks in the list are ignored.
  • order is optional. Omitted or 0 means the largest value is rank 1. Any other number ranks from the smallest up.

#N/A is returned if number is not in the list, which can happen when a value is typed rather than referenced, or stored as text.

Compatibility

RANK.AVG arrived in Excel 2010 and has no older equivalent, so a workbook that uses it will not calculate in Excel 2007 or earlier. If a file must work there, use RANK, which behaves like RANK.EQ, or build the average rank with COUNTIF: =RANK(B2,$B$2:$B$6)+(COUNTIF($B$2:$B$6,B2)-1)/2.

To find which value holds a given rank, use LARGE or SMALL.

Arguments

number
The value to rank, usually a cell such as B2. It must appear in ref, or the result is #N/A.
ref
The list of numbers to rank against, such as $B$2:$B$6. Lock it with dollar signs when you fill the formula down. Text and blanks are ignored.
orderoptional
0 or omitted ranks from the largest down, so the biggest value is 1. Any other number, such as 1, ranks from the smallest up.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Tied values get the average rank

C3 =RANK.AVG(B3,$B$2:$B$6)

Result: 3.5

The two 85s occupy third and fourth place, so each gets the average, 3.5.

C3
A
B
C
1
Student
Score
Rank
2
S1
90
3
S2
85
3.5
4
S3
85
5
S4
70
6
S5
95
7
8

C3 =RANK.AVG(B3,$B$2:$B$6) returns 3.5

Example 2

Without ties, it matches RANK.EQ

C2 =RANK.AVG(B2,$B$2:$B$6)

Result: 2

Only 95 beats 90, so the rank is 2, exactly what RANK.EQ would return.

C2
A
B
C
1
Student
Score
Rank
2
S1
90
2
3
S2
85
4
S3
85
5
S4
70
6
S5
95
7
8

C2 =RANK.AVG(B2,$B$2:$B$6) returns 2

Example 3

Rank from the smallest up

C3 =RANK.AVG(B3,$B$2:$B$6,1)

Result: 2.5

Ranked from the bottom, 70 is first, and the two 85s share second and third, so each is 2.5.

C3
A
B
C
1
Student
Score
Rank
2
S1
90
3
S2
85
2.5
4
S3
85
5
S4
70
6
S5
95
7
8

C3 =RANK.AVG(B3,$B$2:$B$6,1) returns 2.5

Example 4

Side by side with RANK.EQ

C3 =RANK.EQ(B3,$B$2:$B$6)

Result: 3

For the same 85, RANK.EQ returns 3 where RANK.AVG returns 3.5.

C3
A
B
C
1
Student
Score
RANK.EQ
2
S1
90
3
S2
85
3
4
S3
85
5
S4
70
6
S5
95
7
8

C3 =RANK.EQ(B3,$B$2:$B$6) returns 3

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In C2, rank each score so that tied scores share the average of their ranks, with the highest score ranked 1. Fill down to C7.

Answer in C2, then it fills down to C7.

C2
A
B
C
D
1
Entrant
Score
Rank, high first
Rank, low first
2
E1
78
3
E2
92
4
E3
85
5
E4
92
6
E5
70
7
E6
85
8

Common mistakes

  • Average ranks can be fractions such as 3.5. Do not use them to look up a position in a list with INDEX, which needs whole numbers.
  • Forgetting $ on the list. RANK.AVG(B2,B2:B6) filled down slides the range and gives wrong ranks. Write $B$2:$B$6.
  • #N/A means the number is not in the list. Use cell references rather than typed numbers, and check for text numbers.
  • RANK.AVG does not exist before Excel 2010. For a file that must open in older versions, use RANK with a COUNTIF adjustment.
  • The order argument is easy to flip. Omitted or 0 puts the largest first; any other number puts the smallest first.

Questions people ask

When should I use RANK.AVG instead of RANK.EQ?

Use RANK.AVG when the ranks feed a rank-based statistic, or when tied rows must share the ranks fairly. Use RANK.EQ for league tables, where "joint third" is the natural way to show a tie.

Why does RANK.AVG return a decimal?

Two or more values are tied. They share the positions they occupy, so the average of 3 and 4 is 3.5.

Is there an older version of RANK.AVG?

No. RANK.AVG was introduced in Excel 2010. The older RANK function behaves like RANK.EQ.

How do I rank from smallest to largest?

Set the third argument to 1: `=RANK.AVG(B2,$B$2:$B$6,1)`.

Learn RANK.AVG in a real sheet.

RANK.AVG is taught in Data analysis with formulas, lesson 17: RANK and ranking within groups. Each lesson is a short, graded exercise like the one above.