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.

Schedule a free automation consult
Learn more

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