In this article:

How to Sort Rows in Google Sheets in 4 Simple Steps

May 8, 2024

In this article we will show you how to sort rows in Google Sheets by using the built in sort feature.

For the purpose of these examples a data set has been created. Click here to access the sheet and follow along at home.

How to Sort by Row in Google Sheets (Best Method)

To gain the most versatility when sorting rows we can use the advanced sort range feature in Google Sheets. This allows us to include header rows and include multiple conditions when sorting.


1. Highlight the data you need to sort

In your data set highlight the cells you wish to sort. This can be achieved by clicking and dragging over the cells.

In our example we wish to sort the rows in the Age column in ascending order, we must ensure this data is included in the selection.

For our demonstration we will select all data in the table including the header rows.

How to sort rows in Google Sheets

2. Select Data > Sort range > Advanced range sorting options 

The advanced range sorting options can be accessed by clicking on Data from the top toolbar followed by selecting Sort range. From the side menu that appears click on Advanced range sorting options.

How to sort rows in Google Sheets: Advanced range sorting options

Alternatively the Advance range sorting options can be accessed by right clicking on the highlighted data. From the displayed menu click on View more cell actions followed by Sort range.

Google Sheets sort by row

3. Specify the advanced sorting options

A pop up menu will now appear with a variety of range sorting options:

Data has header row: When this option is checked Google Sheets will use the data contained in the header row as an identifier for the sort selection.

Sort by: Clicking this option will display all the columns in the selection. If the data has a header row has been checked the header data will be displayed.

A → Z / Z → A: These select buttons represent the order of the sorted data. A to Z will sort the data in an ascending order. Selecting Z to A will sort the data in a descending order.

Add another sort column: This option allows you to add a secondary sort column.

In our example we have included the header row and we want to sort by the age column in an ascending order. To achieve this we first check the box next to Data has header row, then we will select age from the Sort by dropdown menu. Finally we will ensure the button next to A → Z is selected.

Sort by row Google Sheets‍

4. Select Sort to see the results

Click on the Sort button in the advanced sorting options window. This will sort your rows to your specified conditions. 

In our example we can now see that all the age data has been sorted in an ascending order whilst retaining the header column.

Sort by row Google Sheets: Results

Sort by Row Google Sheets (Basic Method)

There is a more basic method to sorting rows in Google Sheets. This method is efficient but has limitations over the advanced sort method. It cannot distinguish the header row and only a basic sort of A-Z or Z-A can be performed.

1. Select the exact data to be included in the sort

Select only the data you want to sort. 

Note: if you have a header row do not include this as it will be sorted as standard data.

In our example we will now order the name data in a descending order. As our data set contains a header we will not include this in the selection.

How to sort by row in Google Sheets

2. Click on Data > Sort range > Sort range by column (Asc/Desc)

From the top toolbar select Data followed by Sort range. A side menu will appear with the following options:

Sort range by Column (A to Z): Sorts the selected rows in an ascending order.

Sort range by Column (Z to A): Sorts the selected rows in a descending order.

In our example we have selected data from Column B which displays in our sort range options. As we want to order our data in a descending order we will click Sort range by Column B (Z to A).

How to sort by row in Google Sheets: Sorting

3. See the results

After clicking on the relevant sort option the selected data is sorted.

In our example we can see the selected rows under the Name header have been sorted by descending order.

How to sort rows in Google Sheets

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

If you want to learn how to mail merge labels from Google Sheets or how to sort Google Sheets by last name, we also suggest checking out our detailed guide.

Get Google Sheets productivity and automation tips delivered straight to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
We'll email you 1-3 times a week — and never share your information.
Get your copy of our free Google Sheets automation guide!
  • 27 pages of Google Sheets tips and tricks to save time
  • Covers pivot tables and other advanced topics
  • 100% free

Work less, automate more!

Use Lido to connect your spreadsheets to email, Slack, calendars, and more to automate data transfers and eliminate manual copying and pasting. View all use cases ->