RANK Function
Gives the rank of a value in a dataset, with ties sharing a rank.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| number | The value whose rank you want to find. | Required |
| ref | The list (range or array) of numbers to rank against. | Required |
| order | Optional. 0 or omitted = descending (largest = rank 1); any nonzero value = ascending (smallest = rank 1). | Optional |
Basic Example
Rank of 30 in a descending list
=RANK(30, {10,20,30,40,50})In descending order 50=1, 40=2, 30=3, so 30 is rank 3.
Advanced Examples
Example 1: Tied values share the same rank
Two equal entries in the listRANK assigns the same rank to equal values and skips the next rank.
=RANK(20, {10,20,20,30})Example 2: Ascending order ranking
Smallest value should be firstSet order to 1 so the smallest number gets rank 1.
=RANK(10, {10,20,30,40,50}, 1)How RANK Works
RANK compares a value to the other numbers in the reference list. By default (order 0) it ranks from largest to smallest, giving the largest value rank 1; order 1 ranks smallest to largest. Equal values receive the same rank, and the next rank is skipped (e.g. two values at rank 2 leave the next value at rank 4). This tie behavior matches RANK.EQ. In Microsoft 365 use RANK.EQ or RANK.AVG instead.
Important Notes & Limitations
Tied values share a rank and subsequent ranks are skipped, which can distort percentile-style analysis.
Cannot give fractional (averaged) ranks for ties; use RANK.AVG for that.
Considers only numbers; text in the reference is ignored.
Common Errors & Fixes
#N/A errorThe number is not found in the reference list (or the list has no numbers).Fix: Ensure the value exists in the reference, or rank against the actual data range.
Wrong ranking directionForgetting the order argument defaults to descending.Fix: Add 1 as the third argument for ascending ranking.
Download Practice File
RANK
rankPractice RANK with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the RANK function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps