In this article:

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

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.

Check out our software for tracking legal deadlines.

Automate everything you track in spreadsheets with Lido
Learn more

Level up your Google Sheets skills with our free Google Sheets automation guide

Wasting too much time doing things manually in spreadsheets? Want to spend more time doing what you love? Our 100% free, 27-page Google Sheets automation guide is full of new tips and tricks that will save you time and money!