Data Transformation FormulaGoogle Sheets V8 Engine Verified

Google Sheets SORT: Sort Data by Multiple Columns Ascending/Descending

SORT reorders the rows of an array or range based on values in one or more specified columns without modifying the original raw data table.

Formula Syntax:=SORT(range, sort_column, is_ascending, [sort_column2, is_ascending2, ...])

Formula Parameters & Arguments

ArgumentTypeRequiredDescription
rangeRangeRequiredThe table to sort.
sort_columnInteger / RangeRequiredThe column index to sort by (1 = first col).
is_ascendingBooleanRequiredTRUE = Ascending (A-Z / Low to High), FALSE = Descending (Z-A / High to Low).

Real-World Spreadsheet Examples

Explore verified operational formulas used in enterprise reporting and database workflows:

Example 1: Sort Deals by Revenue Highest First

=SORT(A2:E100, 4, FALSE)
How it works: Sorts rows by Column 4 (Revenue) in descending order.

Example 2: Two-Tier Sorting (Department A-Z, then Salary High-to-Low)

=SORT(A2:D50, 2, TRUE, 4, FALSE)
How it works: Groups by Department, then sorts salaries within each group.

Example 3: Sort Filtered Results Dynamically

=SORT(FILTER(A2:D, D2:D > 5000), 4, FALSE)
How it works: Filters and sorts simultaneously.

Common Errors & Solutions

❌ #VALUE! Sort column out of range
Resolution: The sort_column index must be between 1 and the total number of columns in the range.

Performance Pro Tips

  • Pass FALSE as the 3rd argument for reverse chronological sorting on timestamps.

Frequently Asked Questions

Does SORT recalculate automatically when data changes?

Yes. Google Sheets recalculates all dependent formulas immediately whenever referenced input cells are modified.

Is this formula compatible with Microsoft Excel?

Modern functions like XLOOKUP, FILTER, UNIQUE, SORT, and LET are natively supported in Excel 365. However, QUERY is unique to Google Sheets and uses the Google Visualization API syntax.

Related Google Sheets Formulas