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
| Argument | Type | Required | Default |
|---|---|---|---|
number | number (range) | Required | — |
ref | number (range) | Required | — |
order | number (range) | Optional | — |
Remarks
- Omitting
order, or settingorderto0, ranks values in descending order. - Any non-zero
orderranks values in ascending order. - If
numberappears multiple times, the function returns the mean of those rank positions.
Error cases
- Returns
#N/Aifnumberis not found inref.
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)
| A | |
|---|---|
| 1 | 50 |
| 2 | 20 |
| 3 | 20 |
| 4 | 10 |
| 5 | 5 |
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?.
Related functions
FAQ
How are ties handled by RANK.AVG?
All tied occurrences share the average of their rank positions.