Formualizer Docs

RANK.AVG

Returns the rank position of a number, averaging the rank positions for ties.

Use RANK.AVG when tied values should share the average of their occupied rank positions.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

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

Arguments

ArgumentTypeRequiredDefault
numbernumber (range)Required—
refnumber (range)Required—
ordernumber (range)Optional—

Remarks

  • Omitting order, or setting order to 0, ranks values in descending order.
  • Any non-zero order ranks values in ascending order.
  • If number appears multiple times, the function returns the mean of those rank positions.

Error cases

  • Returns #N/A if number is not found in ref.

Examples

Rank a value tied with a second observation.

Formula =RANK.AVG(20,{10,20,20,40,50})

Expected result 3.5

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Select ascending ranking instead of descending ranking.

Formula =RANK.AVG(20,{10,20,20,40,50},1)

Expected result 2.5

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

The largest value is ranked first in descending order.

Formula =RANK.AVG(40,{10,20,20,40})

Expected result 1

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

A value absent from the source array has no rank.

Formula =RANK.AVG(25,{10,20,20,40})

Expected result #N/A

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Average rank for tied values

Formula =RANK.AVG(20,{30,20,20,10})

Expected result 2.5

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Ascending average rank from a range

Formula =RANK.AVG(A2,A1:A5,1)

Input cells
A
150
220
320
410
55

Expected result 3.5

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

FAQ

How are ties handled by RANK.AVG?

All tied occurrences share the average of their rank positions.

Implementation

Engine source

On this page