SORT creates an ordered copy of a Google Sheets range while leaving the source in place. It can sort by numbers, text, or several columns in order.
Use TRUE for ascending order and FALSE for descending order. Include the whole record in the source range so labels stay with their values.
SORT function syntax
=SORT(range, sort_column, is_ascending, [sort_column2, is_ascending2, ...])
- range: the rows to return, normally excluding headers.
- sort_column: a column position within the range, or a separate single-column range with the same row count.
- is_ascending: TRUE for low to high or A to Z; FALSE reverses the order.
- Additional column/direction pairs break ties in the order supplied.
The Google SORT reference describes the function arguments.
Example data
Enter this dataset starting in A1. Leave cells marked “leave empty” empty; type any displayed formula as a formula. Keep a separate blank area for the results.
| Item | Units | Team |
|---|---|---|
| Pens | 55 | Red |
| Folders | 95 | Blue |
| Clips | 62 | Red |
| Pads | 80 | Blue |
| Ink | 50 | Red |
The examples below use this dataset unless the formula supplies its own values. Array results need enough empty cells to expand. The formulas use commas as argument separators. Your spreadsheet locale may require semicolons.
Sort a table in ascending order
The second column contains units. Sorting it ascending puts Ink first at 50 and Folders last at 95, keeping each product and team together.
=SORT(A2:C6,2,TRUE)
| Ink | 50 | Red |
| Pens | 55 | Red |
| Clips | 62 | Red |
| Pads | 80 | Blue |
| Folders | 95 | Blue |

Put the largest value first
Changing the direction to FALSE puts Folders first. The source table remains unchanged, and the sorted output recalculates when its source values change.
=SORT(A2:C6,2,FALSE)
| Folders | 95 | Blue |
| Pads | 80 | Blue |
| Clips | 62 | Red |
| Pens | 55 | Red |
| Ink | 50 | Red |
Sort text alphabetically
Column 1 contains product names. TRUE orders them alphabetically, starting with Clips. Numbers and team labels travel with their original product.
=SORT(A2:C6,1,TRUE)
| Clips | 62 | Red |
| Folders | 95 | Blue |
| Ink | 50 | Red |
| Pads | 80 | Blue |
| Pens | 55 | Red |
Sort by more than one column
Sort by team first, then units descending within each team. The second key resolves ties in the first key; it does not replace the first ordering.
=SORT(A2:C6,3,TRUE,2,FALSE)
| Folders | 95 | Blue |
| Pads | 80 | Blue |
| Clips | 62 | Red |
| Pens | 55 | Red |
| Ink | 50 | Red |
Sort a filtered result
FILTER keeps only products with more than 50 units. SORT orders those remaining rows by units descending.
=SORT(FILTER(A2:B6,B2:B6>50),2,FALSE)
| Folders | 95 |
| Pads | 80 |
| Clips | 62 |
| Pens | 55 |
For values between 50 and 60 inclusive, use both bounds inside FILTER, then sort the resulting single column ascending.
=SORT(FILTER(B2:B6,B2:B6>=50,B2:B6<=60),1,TRUE)
| 50 |
| 55 |
Use a separate sort-key column
Return just the product names while using B2:B6 as the ordering key. This keeps the key out of the displayed result.
=SORT(A2:A6,B2:B6,FALSE)
| Folders |
| Pads |
| Clips |
| Pens |
| Ink |
Other Google Sheets articles you may also like