Function reference · Array & filter

SORT

Returns a range sorted by one or more of its columns.

SORT(range, sort_column, is_ascending, [sort_column2, is_ascending2, ...])

SORT sorts as a formula rather than as a one-off action, so the output re-sorts itself whenever the source data changes. That makes it the right tool for a live leaderboard or top-ten table.

Arguments

ArgumentRequiredWhat it does
range Yes The rows to sort.
sort_column Yes Which column to sort by, counted within the range.
is_ascending Yes TRUE for A→Z or small→large, FALSE for the reverse.

Worked example

RegionRepSales
WestAna1200
EastBen900
WestCara1500
NorthDan600
EastEve1100
=SORT(A2:C6, 3, FALSE)

Returns Cara 1500 first, Dan 600 last.

Sorted by the third column of the range — sales — highest first.

Gotchas

Related functions