Home › Functions › Filter & Sort › SORT
Filter & Sort function
SORT function in Google Sheets
SORT returns a sorted copy of a range, ordered by one or more columns, without rearranging the original data. Because it is a formula, the sorted list stays in order as values change or rows are added, which the Data › Sort range menu can't do.
Syntax
=SORT(range, sort_column, is_ascending, [sort_column2, is_ascending2, ...])
rangeThe data to sort, without its header row. sort_columnWhich column to sort by: a number counting from the first column of range (1, 2, 3…), or a separate one-column range with the same number of rows. is_ascendingTRUE for A→Z and smallest first, FALSE for Z→A and largest first. sort_column2, is_ascending2, ...Optional. More columns to break ties, each with its own direction.
Practice SORT
Sort the whole table (A to C) by sales, highest first . Put the sorted copy in E2 .
Check answer
Hint
Show answer
↻ New data
Tip: while typing a formula, click a cell or drag across cells to insert references. Press Enter to check, and Tab to accept a function suggestion.
This interactive exercise needs JavaScript enabled.
SORT examples
Each example below runs against this sample sheet. The results are calculated by the same engine as the practice grid.
Sales by rep
Tips and common mistakes
sort_column counts within the range. In SORT(C2:E9, 2, TRUE), 2 means column D, not column B. Leave the header row out of the range or it gets sorted in with the data. Blank rows always sort to the bottom, in both directions, so open-ended ranges like A2:E are safe. Rows that tie keep their original order. Add a second sort column if you need a specific tie-break. To get the top N rows, combine SORT with ARRAY_CONSTRAIN, or use QUERY with order by and limit.
Related functions
Learning step by step? SORT is covered in Lesson 34: SORT & UNIQUE of the free course.