Google Sheets Sort Range
Sort Range
The Sort Range command in Google Sheets allows for more complex sorting of data.
For example it can work with data which has headers or have multiple sort rules.
Handling Data with Headers
Sort range makes it very easy to sort data with headers.
Example
Sort the Pokemon in the range A2:A21
by their Total stats, ascending from smallest to largest (A-Z).
Copy the values to follow along.
Sort range, step by step:
- Select all the data, range
A2:B21
- Click on the Data menu and find Sort range
- Click on Sort range
- Select Data has header row
- Select Total stats which is the header for column
B
- Click Sort
Well Done! You have successfully sorted the Pokemon by their total stats.
Multi-Level Sorting
Google Sheets lets you sort your data in multiple levels.
Example
Sort the Pokemon in the range A2:A21
by their Total stats, ascending from smallest to largest (A-Z) and then sort the results based on their Name.
Multi-level sort range, step by step:
- Select all the data, range
A2:B21
- Click on the Data menu and find Sort range
- Click on Sort range
- Select Data has header row
- Select Total stats which is the header for column
B
- Click on Add another sort column
- Select Name which is the header for column
A
- Click Sort
Let's compare the results of this example with the previous example:
The image with the blue rectangle is the result of the first example and the image with the green rectangle is the result of the second example.
Look at rows 14:16
.
The order of Pokemon has changed. In the second example they are also sorted alphabetically.
This is because we added an additional sort rule to Sort range.