In this article:

How to Sort by Multiple Columns in Google Sheets (Easiest Way)

Structured data often contains several columns for identifying information that can be used to sort the data. These include dates, locations, and customer groups. Google Sheets allows users to set multiple sort columns. In this tutorial, we will learn how to sort by multiple columns in Google Sheets. Are you ready?

Google Sheets Sort by Multiple Columns

Step 1: Select all the data to be sorted.

Our example is using the populations, within the city limits, of the 34 largest European cities. By selecting the entire range, you can sort multiple columns at once by choosing the sorting column or columns and in what order you want to sort.

Data to be sorted.
Data to be sorted

In our Google Sheets sort example, we want to sort by Country first (stored in Column B) then by population (stored in Column B). 

Step 2. Click Data in the main menu, then Sort range -> Advanced range sorting options

Data option in main toolbar, Sort range option, Advanced range sorting options.
Data option in main toolbar, Sort range option, Advanced range sorting options.

Step 3. Select you sort options for the first column from the dialogue box.

Sort range options
Sort range options

If the data has a header row, click the checkbox Data has header row. The label will change to the headers stored in the header rows.

Sort range options. Data has header row checkbox ticked.
Sort range options. Data has header row checkbox ticked.

By default, Google Sheets will only sort by the first column.

In our example, however, we want to sort multiple columns, and our first criterion, the country name, is in Column B. The city name is in column A, but we want to sort first by the country name. Therefore, we clicked on the dropdown menu and select "Country."

Additionally, by default, the sort is in ascending order, indicated as A -> Z in the box. To sort  in descending order, click the button besides Z -> A.

Step 4. Click Add another sort column. 

The same options will appear. In this case, we then sort by the Official Population, which we select in the drop-down box. However, we will sort by the populations by descending order so that the cities with the highest populations in each country will appear first in the sorted data.

Options to sort by multiple columns
Options to sort by multiple columns

Step 5. Repeat Step 4 to add another sort column if necessary.

For our example, we just need two columns. After adding all the necessary columns, click the Sort button.

Our table is now sorted.

Data sorted by multiple columns
Data sorted by multiple columns

Reverting back to original data in Google Sheets

Sometimes, you only want to temporarily sort multiple columns in Google Sheets to find a specific piece of information.

The easiest method to undo sorting immediately is to click the Undo button in the main menu or use CTRL + Z.

However, this option is not always feasible if you have made some edits to the spreadsheet after you sort range by multiple columns.

An easy way to revert back to your original data involves inserting an extra column with each row numbered.

Start by selecting a column and right-clicking, then insert a new column to the left.

Insert new column
Insert new column

Then, you add number that column to correspond to each row of original data.

To do this quickly, type 1, 2, 3 in the first three cells, then select the cells and drag the formatting down the column by clicking and dragging the blue square in the bottom right corner of the three selected cells.

Each data entry numbered to remove sorting
Each data entry numbered to remove sorting

Include this row when you sort the data, which will result in the numbers jumbling together when you sort by country and population.

Sorted data in Google Sheets
Sorted data in Google Sheets

However, this numbered column makes reverting the data a breeze. Simply follow the steps in the tutorial above and only sort by the numbered columns in ascending order.

Sorting by "Reverting," which is the numbered column
Sorting by "Reverting," which is the numbered column

Click sort and voila! Your data will return to its original position.

Reminder: Make sure to sort by ascending order! Descending order will reverse the original order of your order by putting the last entry first.

Other Ways to Sort in Google Sheets

Google Sheets is a brilliant way to manipulate and organize your data. You can sort your data by date, by number, by color, alphabetically, or automatically.

Check out main Google Sheets SORT article to find about everything you need to know to get the most out of Google Sheets.

Google Sheets Sample Sheet

Click here to access our sample spreadsheet with all of our example data.

Use our insurance renewal reminder software to easily set up custom reminders from your spreadsheet in just a few clicks. 

If you enjoyed this article, you might also like our article on how to use the SORT function in Google Sheets or our article on how to use the SORT columns in Google Sheets. 

If you want to learn how to use the Google Sheets sort by number function or how to link an email in Google Sheets, we also suggest checking out our detailed guide.

Automate repetitive tasks with Lido

Save hours on repetitive and tedious work. Lido is a new spreadsheet that connects your spreadsheets, forms, PDFs, and email inbox.

Trigger
Action
Select trigger
When a cell value in Google Sheets changes
Check Google Sheets for today's date
When a new row is added to Google Sheets
On new Google Form submission
Send me a daily reminder
On new Typeform submission
When a cell value in database changes
Check database for today's date
When a new row is added in database
When a new HubSpot customer is created
Select action
ADDCALENDAREVENT
Creates a one- or multiple-day calendar event with optional attendees
ADDHUBSPOT
Adds an object to Hubspot
ADDSLACKCHANNEL
Create a Slack channel, and optionally add a topic or members
CALLURL
Makes any HTTP request
CREATEGOOGLEDOC
Replaces [@column_name] values in a Google Doc with the corresponding table row's values
CREATEPDF
Replaces [@column_name] values in a Google Doc with the corresponding table row's values, then export it as a PDF
FETCH
Makes any HTTP request and returns the response
INSERTROWS
Inserts given array below defined values in given worksheet
SENDGMAIL
Sends an email using your Google account
SENDOUTLOOK
Sends an email using your Microsoft Outlook account
SENDSLACK
Sends a Slack message
SENDSMS
Sends an SMS message using your Twilio account
UPDATECELL
Updates cells with given values
UPDATEHUBSPOT
Updates a property of a Hubspot object
Trigger is required
Action is required
Get started