TRUECALC
Functions

RANK

Rank of number (ties=lowest)

Try it

When to use it

When should I use RANK instead of sorting the data?

RANK gives the position of one value within a set without reordering anything, so it works in place for leaderboards and percentile-style reports while the original rows stay put.

How do I rank from smallest to largest instead of largest to smallest?

Pass 1 as the third argument. RANK(value, range, 1) ranks in ascending order, where the smallest value is rank 1; the default 0 ranks in descending order.

Use cases

Rank a score against other grades

Rank a cost ascending so cheapest is first

Used in

education · finance · operations

Syntax

RANK(number,ref,[order])

Examples

=RANK(4,{1,2,3,4,5,6,7,8,9,10}) // => 7
=RANK(4,{1,2,3,4,5,6,7,8,9,10},1) // => 4
=RANK(10,{1,2,3,4,5,6,7,8,9,10}) // => 1

On this page