The ability to quickly and easily sort large amounts of data is one of the most useful things about spreadsheets.
There are a number of ways to do this. Here you’ll learn about the SORT function.
SORT
This function takes in data and sorts it by one or more of the columns present. You can also sort data by referencing an external column.
Syntax
- range = the data you want to sort, it can be an array of data or a range reference
- sort_column = the index of the column by which you want your data sorted (e.g. 2) or a range reference to a column outside the range that has the same number of rows as the range
- is_ascending = TRUE or FALSE setting that determines if the data is sorted in ascending order (TRUE = 1➜9 or A➜Z) or descending order (FALSE = 9➜1 or Z➜A)
- [sort_column2, is_ascending2, ...]= option to add multiple additional sort_column indexes or ranges and corresponding is_ascending choices, with preference given left to right
By default the SORT function assumes sort_column = 1 and is_ascending = TRUE. If that’s the case for your data you can leave these arguments out of the function.
Example
Here’s some data:
A | B | |
1 | Name | Age |
2 | Jane | 32 |
3 | James | 56 |
4 | John | 24 |
5 | Julia | 33 |
Let’s sort the data by name:
C | D | |
1 | Name | Age |
2 | James | 56 |
3 | Jane | 32 |
4 | John | 24 |
5 | Julia | 33 |
By age:
C | D | |
1 | Name | Age |
2 | John | 24 |
3 | Jane | 32 |
4 | Julia | 33 |
5 | James | 56 |
Or just the names, but descending by age:
E | |
1 | Name |
2 | James |
3 | Julia |
4 | Jane |
5 | John |
It’s a powerful function with a lot of options.
A | B | C | |
1 | First | Last | Sales |
2 | Dwight | Schrute | 10,000 |
3 | Jim | Halpert | 8,000 |
4 | Stanley | Hudson | 7,000 |
5 | Phyllis | Vance | 6,000 |
6 | Andy | Bernard | 4,000 |
7 | |||
8 | First | Last | Sales |
9 | |||
10 | |||
11 | |||
12 | |||
13 | |||
14 |
FREE RESOURCE
Google Sheets Cheat Sheet
12 exclusive tips to make user-friendly sheets from today:
You'll get updates from me with an easy-to-find "unsubscribe" link.