Today, we are going to discuss how to sort by column in Google Sheets. We discuss three unique methods, each with their respective pros and scenarios where they can be utilized.
But before that, let’s look at the basics of sorting in Google Sheets.
Sort Basics in Google Sheets
Let’s first understand how sort works in Google Sheets. For our example, we will sort the following column of data.
Fundamentally, the sort function of Google Sheets is called Sort Range. We can find this under the Data tab of the toolbar (after a sorting range is selected.
Or by right-clicking over the selected cells.
Right-Click > View more cell actions > Sort range
Here, we have two choices:
- Sort range by Column (A to Z): Ascending order
- Sort range by Column (Z to A): Descending order
For our example, we have selected option 1. The result:
This covers the fundamentals of sorting in Google Sheets. In a practical scenario, we often have to sort more than one column as our table and datasets usually have multiple of them. This brings us to the topic of our article today, how to sort by column in Google Sheets.
3 Ways to Sort By Column In Google Sheets
To show our processes, we have created the following table where we can sort multiple columns by one or many columns.
1. Sort By Column Using Sort Range
Our first method of sorting by column in Google Sheets will use the built-in Sort range function, the advanced version of it to be precise.
We want to sort the table in the descending order of products sold (highest Sold first).
We go through this process step-by-step:
Step 1: Select the table. We have included the table headers.
Step 2: Navigate to Sort range’s advanced options. Data > Sort range > Advanced range sorting options
This should open the Sort range window with some advanced options for us to utilize.
Step 3: Here, we set the following conditions:
- Check the Data has header row option. Since our selection included the table headers, this option must be checked if we want to avoid errors. This will also make the headers appears as Sort by conditions.
- Sort by: Sold. Our column selection by which the table will be sorted.
- Z to A: The descending order condition. Highest to the lowest down the column.
Step 4: Click Sort.
As we have sorted the Sold column, the rest of the rows of the table has also been sorted accordingly.
Sort by Multiple Columns
Now, we will look at how we can apply two levels of conditions to our sort by columns. We will sort the table by their Shop names first then according to the amount Sold.
Step 1: Open the advanced Sort range window.
Check the Data has header row option if your selection includes headers.
Step 2: We set our first condition, the Shop names by ascending order.
Step 3: We now add the second column condition. Click on the Add another sort column button.
Our second condition is Sold in descending order.
Step 4: Click Sort.
We have successfully sorted our table by the Shop names first and then the amount Sold.
This method is viable for any size of tables and for as many conditions as you can apply.
2. Sort by Column Using Filter
This next method is a bit unorthodox, but it still gets the job done. Here, we will sort our table by column using the Filter function of Google Sheets. We will once again sort the entire table by the Sold column in descending order.
Step 1: Select the whole table and navigate to the Filter function on the Toolbar.
This creates a filter on the table headers.
Step 2: Select the filter of the Sold table. Select Sort Z to A.
Step 3: Click OK. Our result:
3. Sort By Column Using a Formula
Our final method combines the idea of our last two and gives us something much more dynamic. That is, sorting by column using the SORT function of Google Sheets.
The SORT function syntax:
SORT(range, sort_column, is_ascending, [sort_column2, is_ascending2, ...])
To work this method, we must create a separate table and populate it with our new sorted values.
Step 1: Create a new table and start the formula
Step 2: Select the range of values of the original table. In our case. it is B3:D12.
Step 3: Our sort_column value will be 3. Because the Sold column is in the third position of our selection.
Step 4: The is_ascending condition will be FALSE, as we want the sort to be in descending order.
Step 5: Close parentheses and press ENTER.
We called this method dynamic because as we change the data within the source table, the sorted table data will also change accordingly:
Sort by Multiple Columns
With the SORT function, we can add multiple column conditions. Let’s try it out with the condition we have used in method 1 of this article: sort the table by their Shop names first then according to the amount Sold.
Our formula with the two conditions:
We hope that all the methods we have discussed of how to sort by column in Google Sheets come in handy in your day-to-day tasks.
Please feel free to leave any queries or advice you might have for us.