Description
Use this function to determine the rank of a number in a list of numbers. Supported in Chains. Can be used with CHILDREFS.
RANK is useful for finding the relative standing of a value within a dataset.
Syntax
RANK(number, ref_1, […, ref_254, [order])
Inputs
This function accepts the following arguments:
| Name | Required | Description | Valid input |
|---|---|---|---|
number |
Yes | The number whose rank you want to find. | A number, a reference to a cell containing a number, or a formula which results in either of these. |
ref_1, ref_n |
Yes | The range of numbers to which the number is to be compared. |
A cell range, a set of numbers, a reference to a cell containing either of these, or a formula which results in any of these. Up to 255 values can be provided. |
order |
No | A number specifying how to rank the number. |
A value of 1 for ascending order, or 0 for descending order. If omitted, "0" is used. |
Example
Data
| A | B |
|---|---|
| 10 | 3 |
| 20 | 19 |
| 15 | George |
| 25 | 45 |
| 30 | -8 |
Examples
| Formula | Description | Result |
|---|---|---|
=RANK(A2, A1:B5) |
Returns the descending order rank of the number in cell A2 within the range A1:B5. (B3 is ignored because it is text.) | 4 |
=RANK(A3, A1:A5, 1) |
Returns the ascending order rank of the number in cell A3 within the range A1:A5. | 2 |
=RANK(25, A1:B5) |
Returns the rank of the number 25 within the range A1:B5 in descending order. (B3 is ignored because it is text.) | 3 |
=RANK(B5, A1:B5, 1) |
Returns the rank of the number in cell B5 within the range A1:B5 in ascending order. (B3 is ignored because it is text.) | 1 |
Notes
- If two or more numbers in the list are the same, they will have the same rank. However, this will affect the ranks of subsequent numbers.
- Non-numeric values (empty cells, text values, and logical values) in
refare ignored. - If a cell in the range
refhas an error, that error will be returned. - The order argument is optional. If omitted, RANK results use descending order.
- Use RANK.EQ to resolve ties by assigning the average rank to each tied value.
Tips
- RANK can be used with COUNT to handle tie values and adjust ranks accordingly.
- RANK is useful in creating rankings for performance, sales, or other measurable data sets.
- For datasets larger than 255 values, we suggest using helper columns to consolidate values.
- You can combine RANK with other functions such as IF, INDEX, and VLOOKUP to create dynamic reports and dashboards.
Related functions
AVERAGE
AVERAGEA
AVERAGEIF
AVERAGEIFS
LARGE
MAX
MAXA
MAXIFS
MEDIAN
MIN
MINA
MINIFS
PERCENTILE
PERCENTILE.EXC
PERCENTILE.INC
QUARTILE
QUARTILE.EXC
QUARTILE.INC
RANK
RANK.AVG
RANK.EQ
SMALL
STDEV
STDEV.P
STDEV.S
STDEVA
STDEVPA