Formualizer Docs

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

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.
  • Tied values receive the same rank (the first matching position in the sorted list).

Error cases

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

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)

Input cells
A
150
220
320
410
55

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?.

FAQ

When does RANK.EQ return #N/A?

It returns #N/A when the target number does not appear in the reference set.

Implementation

Engine source

On this page