Google Sheets function · Statistical
RANK in Google Sheets: syntax and examples
RANK returns where a value stands in a list of numbers. By default 1 is the largest value, and equal values share the same rank.
Syntax
RANK(value, data, [is_ascending])
Arguments
| Argument | Type | Required | What it does |
|---|---|---|---|
value | number | yes | The number whose position you want. It must exist in data. |
data | range | yes | The range of numbers to rank against. |
is_ascending | boolean | no | FALSE or left out: biggest number is rank 1. TRUE: smallest number is rank 1. |
Examples
The examples use this table, starting in A1:
| Name | Score |
| Ana | 80 |
| Bogdan | 95 |
| Carmen | 80 |
| Dan | 60 |
| Eva | 70 |
=RANK(B2, B2:B6)Result: 2
Rank of 80 in the score list. Another score is higher, so 80 is second.
Run in a Google Sheet (English US locale) on .
=RANK(B3, B2:B6)Result: 1
The highest score is rank 1.
Run in a Google Sheet (English US locale) on .
=RANK(B5, B2:B6, TRUE)Result: 1
With TRUE the order flips: the lowest score is rank 1.
Run in a Google Sheet (English US locale) on .
=RANK(B4, B2:B6)Result: 2
Carmen has the same score as Ana, so both get rank 2 and the next rank is skipped.
Run in a Google Sheet (English US locale) on .
=ARRAYFORMULA(RANK(B2:B6, B2:B6))Result:
| 2 |
| 1 |
| 2 |
| 5 |
| 4 |
One rank per row, in a single formula. Note the gap: there is no rank 3.
Run in a Google Sheet (English US locale) on .
Common errors
- The value must appear in data. A number that is not in the list, such as 85, returns #N/A.
- Ties share a rank and the next rank is skipped. Two values at rank 2 mean the next one is rank 4.
- The default order is descending: 1 is the largest. Pass TRUE as the third argument for 1 to be the smallest.
- Text in data is ignored, so a header row inside the range does not break the ranking.
Compared with Excel
Same syntax as Excel RANK.