How to Sort by Multiple Columns in Google Sheets

To easily analyze large spreadsheets, you can make use of sorting functions that will organize your data. For those using Google’s productivity suite, the built-in sorting function allows users to sort by multiple columns in Google Sheets.

Sort by Multiple Columns in Google Sheets

Sort by Multiple Columns in Google Sheets

In the example below, we have a dataset that contains three columns: city, country, and price.

Suppose you want to sort this dataset so that the countries are alphabetically sorted (from A-Z) and then the dataset is further sorted by prices from lowest to highest. This will group all the cities from one country together and then sort the cities based on lowest to highest price.

ad code here

To sort by multiple columns in Google Sheets, first open the spreadsheet that you want to sort, and then follow the steps below.

1. Select the entire dataset by clicking on a cell in the dataset and then pressing Ctrl + A on your keyboard.

Select Entire Dataset in Google Sheets

Tip: If you are using a Mac, press the Command + A keys instead.

2. With the dataset selected, click on Data from the top menu.

Data Tab in Google Sheets

3. From the dropdown, click on Sort Range > Advanced range sorting options

Advanced Range Sorting Options in Google Sheets

You will see a sort range pop-up box.

4. Select the data has header row option if your data contains a header.

Data Has Header Row Option in Google Sheets

Selecting this option allows you to choose your headings when sorting and will ensure that your header rows aren’t sorted along with the rest of your data.

5. In the dropdown, choose the first column you want to sort by and whether you want to sort in ascending order (A-Z) or descending order (Z-A).

Sort by First Column in Google Sheets

For our example we want to first sort by country alphabetically, so we will choose Country and A-Z.

6. Now click on Add another sort column.

Add Another Sort Column Option in Google Sheets

7. Now choose the second column you want to sort by and whether you want to sort in ascending order or descending order.

Sort by Second Column in Google Sheets

For our example we want to sort by country then price, so we will choose Price and A-Z since we want to sort by lowest to highest price.

8. Click on Sort to sort the dataset.

Sort by Multiple Columns in Google Sheets

You will notice that the dataset has now been sorted according to the columns you have specified.For our example, the dataset was first sorted alphabetically by countries and then further sorted by price, presenting the values below.

Dataset Sorted by Two Columns in Google Sheets

If you want to sort by more than two columns, then simply repeat steps 6 and 7 until you have specified all the columns you wish to sort your dataset by.