New: ready-to-use spreadsheet templatesExplore the collection  →
ARRAY & DATA · GOOGLE SHEETS

SORT
sort rows in a range by one or more columns.

Use SORT to sort a table by highest amount. This guide shows the exact structure, a working example and the mistakes most likely to break it.

JosephineVerified by JosephineReviewed July 25, 2026
THE FORMULA=SORT(range, sort_column, is_ascending, [sort_column2, is_ascending2, …])
A

rangerows to return

B

sort_columncolumn or index to sort

C

is_ascendingTRUE for ascending

TRY IT YOURSELF

Change the sheet.
Watch the answer update.

Edit any highlighted cell below. The example recalculates immediately.

LIVE PLAYGROUND=SORT(A2:C20,3,FALSE)
fx=SORT(A2:C20,3,FALSE)
A · LABELB · VALUE
2
3
4
5
RESULT120, 90, 60, 45Updates live

Try changing a value above. This example runs entirely in your browser.

IN PLAIN ENGLISH

How the formula
thinks.

  1. 01

    rangerows to return

  2. 02

    sort_columncolumn or index to sort

  3. 03

    is_ascendingTRUE for ascending

COMMON FIXES

When SORT
doesn’t behave.

WRONG RESULT

Wrong result

Check that every range starts and ends on the same rows, and that numbers are stored as numbers.

FORMULA PARSE ERROR

Formula parse error

Check commas, quotation marks and closing parentheses. Your locale may use semicolons instead of commas.

UNEXPECTED BLANKS

Unexpected blanks

Test the source cells for hidden spaces, empty strings and inconsistent data types.

fxNeed help with SORT?Fix my formula →