How to Sort a Pivot Table in Google Sheets?

To sort a pivot table in Google Sheets, click on the arrow icon beside the column header you want to sort by and select the sort type from the dropdown menu. You can sort by ascending or descending order, or by value or label. You can also customize the sorting order for specific values. To do this, simply click on the “Custom Sort” option in the dropdown menu and enter how you would like the data to be sorted. After you have made your selections, click the “OK” button and the pivot table will be sorted accordingly.


The easiest way to sort a pivot table in Google Sheets is to use the Sort by function within the Pivot table editor panel.

The following example shows how to use this function in practice.

Example: Sort a Pivot Table in Google Sheets

Suppose we have the following pivot table in Google Sheets:

Click on any cell in the pivot table to bring up the Pivot table editor panel.

Within the Pivot table editor panel, click the dropdown arrow next to Sort by within the Rows section and choose SUM of Sales:

The rows of the pivot table will automatically be sorted by the SUM of Sales column, ascending:

To instead sort the rows in descending order, simply click the dropdown arrow next to Order and select Descending:

The rows of the pivot table will automatically be sorted by the SUM of Sales column, descending:

The following tutorials explain how to perform other common operations in Google Sheets:

x