RANK.EQ
Returns the rank position of a number within a data set, with ties sharing the same rank.
RANK.EQ defaults to descending order (largest value is rank 1), and can switch to ascending
order when order is non-zero.
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.EQ(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. - Tied values receive the same rank (the first matching position in the sorted list).
Error cases
- Returns
#N/Aifnumberis not found inref.
Examples
Rank a value tied with a second observation.
Formula =RANK.EQ(20,{10,20,20,40,50})
Expected result 3
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.EQ(20,{10,20,20,40,50},1)
Expected result 2
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.EQ(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.EQ(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?.
Descending rank with direct values
Formula =RANK.EQ(7,{10,7,4,2})
Expected result 2
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 rank with ties in a range
Formula =RANK.EQ(A2,A1:A5,1)
| A | |
|---|---|
| 1 | 50 |
| 2 | 20 |
| 3 | 20 |
| 4 | 10 |
| 5 | 5 |
Expected result 3
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
When does RANK.EQ return #N/A?
It returns #N/A when the target number does not appear in the reference set.