In this article:

How to Sort the Rows in the Pivot Table in Google Sheets

May 8, 2024

The Pivot Table is Google Sheets’ answer to Microsoft Excel’s PivotTable feature. This feature allows the user to quickly summarize a large amount of structured data through few clicks, giving the user a powerful tool for free. Pivot Table can be a bit more challenging to tame, but this tutorial will help you master it by considering the common demands of data analysis. 

When you select the column that will contain the label of the rows, Pivot Table will automatically sort it in ascending order: from A to Z for the names and labels and from smallest to biggest for the numbers. What if you want to sort it using other data? We will consider it in this tutorial.

We will start with a Pivot Table where we list all the products sold, the number of items sold for each product, the total sales from each product, and the total profit from each.

A pivot table containing the list of products sold, the total number of items sold for each product, the total sales for each product, and the total profit from each product.

Let’s say you want to sort it such that the product with the biggest profit will be on the top. Here are the steps:

Step 1: Look for the Rows label in the Pivot table editor. The listed column used for the rows has a label Sort by with a drop-down list below it. Click on the drop-down list. 

The same pivot table. On the Pivot table editor, under the Rows label, the options for sort by selected. The list includes items, the sum of number of items, the sum of total sales, and the sum of total profit.

Step 2: Since we want to sort it with the biggest profit first, select SUM of profit. Afterward, click on the drop-down box below Order and change the order to Descending

Same pivot table, but with the items rearranged from biggest profit to smallest.
Same pivot table, but with the items rearranged from biggest profit to smallest. 


Here it is! Clearly, the loaf bread is the breadwinner among our products. This will help us decide on which items to prioritize on selling more. 

We hope this article has helped you and given you a better understanding of how to sort the rows in the pivot table in Google Sheets. You might also like our articles on how to use a calculated field in a pivot table on Google Sheets and how to lock cells in Google Sheets.

We also recommend reading our guide on how to check for a valid email in Google Sheets.

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 ->