Practice free

RANK.AVG function

RANK.AVG ranks a number within a list and splits ties fairly by averaging their ranks. Two values tied for 2nd and 3rd both get 2.5.

Example

Read it as a sentence: find the rank of 7 in AJ1:AJ5, counting the largest value as 1 and averaging any ties, which gives 2.

Practice this in the app

Syntax

RANK.AVG(number, ref, [order])

Arguments in [square brackets] are optional.

number (required)
The value to rank.
ref (required)
The list of numbers to rank against.
order (optional)
0 or omitted ranks largest first; any other number ranks smallest first.

Returns: The rank of the number, averaging the rank for ties.

What Excel actually returns

Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.

FormulaExcel showsCase
=RANK.AVG(7,Data!AJ1:AJ5) 2 Descending (default)
=RANK.AVG(3,Data!AJ1:AJ5) 3.5 Tie descending
=RANK.AVG(3,Data!AJ1:AJ5,1) 2.5 Ascending order 1
=RANK.AVG(3,Data!AJ1:AJ5,5) 2.5 Order nonzero = ascending
=RANK.AVG({7;3},Data!AJ1:AJ5) 2 Array number (spills)
=RANK.AVG(Data!AJ1:AJ5,Data!AJ1:AJ5) 2 Whole column of the ref (spills)
=RANK.AVG(4,Data!AJ1:AJ5) #N/A Number not in ref
=RANK.AVG("abc",Data!AJ1:AJ5) #VALUE! Text number

The Data sheet these formulas read

A cell that starts with = holds that formula.

Watch out for

  • The number must exist in ref or you get #N/A.
  • Non-numeric cells in ref are ignored.
  • Excel refuses the formula outright if you type an array constant such as {1,2,3} where a range is expected; point it at cells instead (measured in Excel 16.0.20527).

Where it works

Excel
RANK.AVG arrived in Excel 2010. Older versions do not have it.
Google Sheets
Same name, same behaviour for everyday use.

Part of Statistical functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .