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
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.
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.
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.
3. From the dropdown, click on Sort Range > Advanced range sorting options
You will see a sort range pop-up box.
4. Select the data has header row option if your data contains a header.
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).
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.
7. Now choose the second column you want to sort by and whether you want to sort in ascending order or descending order.
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.
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.
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.