Sort pivot table Google Sheets

Here I have data that is sorted. When you look at the right hand side of the screen, you can see that the cities are sorted in an ascending order. When you check in the pivot table, you can verify that you indeed have Barcelona first, then the letters B, L, M etc.

Sort pivot table Google Sheets


The sum of revenue though is not sorted. It would make sense to have your revenue sorting rather than the cities, you’ll probably want to sort it either in a descending or

or descending order.


Actually, it’s super simple but it’s crazy how long it took me to understand how to do it. Most probably because it’s so different in Google Sheets and in Excel.


In Google Sheets, in the same drop-down menu where you can sort the City data (my 1st column), you can also choose The sum of revenue (my 2nd column).

Sort pivot table Google Sheets


And here it is! You can either sort it in ascending or descending order. Yes, it’s that simple! It's really quick and easy but you first need to find where it is hidden.


Now, let's sort data in Excel


In Excel, it's very different. This might be why it’s so confusing when you try to do the same thing in Google Sheets.


Here, I just need to select the cells in The sum of revenue (my 2nd column), then go in Sort and filter, and click on sort From smallest to largest or From largest to smallest.

The Pivot Table is quite useful for summarizing and reorganizing data in Google Sheets and as well as in other Spreadsheets applications. If you are using this functionality, at some point in time, you may want to sort the grand total columns at the bottom of the Pivot Table report.

It’s possible and quite easy to sort Pivot Table grand total columns in Google Sheets. You can find all the necessary pieces of information related to this below.

Sorting grand total columns in Google Sheets is not the same as in Excel. So, if you are an Excel user, who switched to Docs Sheets, you may take time to find the required steps in Google Sheets. So I hope, you will find this tutorial useful.

Pivot Table Grand Total Columns Sorted in Descending Order:

Sort pivot table Google Sheets

Pivot Table Grand Total Columns Sorted in Ascending Order:

Sort pivot table Google Sheets

To sort Pivot Table Grand Total Columns in ascending or descending order, you must change the settings in your Pivot table editor, that only in one field. No doubt, that is the “Columns” field.

Steps to Sort Pivot Table Grand Total Columns

Before coming to that step, let me show you how to create the above Pivot report (without sorting).

Sample Data:

Sort pivot table Google Sheets

First of all, select the data (A2:C16) and then go to the menu Data > Pivot table.

Select “Insert to new sheet” or “Existing sheet” and choose the cell to insert the table.

Inside the Pivot Chart Editor panel, you must add (1) Rows, (2) Columns, and (3) Values.

In our data, there are three columns. Let me show you how to include these three columns in the Pivot table. You can jump to the screenshot skipping the 3 points below.

  1. Values: The values to sum are in column B (field label “Qty. in Gallon”). So add this field against “Values” and choose the aggregate function that you want. I am using SUM here.
  2. Rows: I am adding the data in column A (field label “Date of Filling”). Simply add this field against “Rows”.
  3. Columns: Now the column left to add is column C (field label “Vehicle No.”). Needless to say, you must add this against “Columns”.
Sort pivot table Google Sheets

Our Pivot Table report is ready. Check the columns. It’s by default sorted based on the field labels (Vehicle No.).

Sort pivot table Google Sheets

Sorting Grand Total Columns in Descending or Ascending Order

To sort the grand total columns (the total row at the bottom) in descending or ascending order, you must edit the “Column” field inside the Pivot Editor.

Just take a look at the “Column” field in the above screenshot. You can see that the default sorting is set to “Ascending” and the sort by is set to field label which is “Vehicle No.”

You must change the field label to ” Sum of Qty. in Gallon” (the filed used in “Values” with aggregation SUM) and then select “Grand Total”.

Sort pivot table Google Sheets

This setting will sort the above Pivot Table Grand Total columns in ascending order. Just change “Ascending” to “Descending” (see the above image) to change pivot table sort order.

How do I sort a pivot table chronologically?

In a PivotTable, click the small arrow next to Row Labels and Column Labels cells. Click a field in the row or column you want to sort. on Row Labels or Column Labels, and then click the sort option you want. To sort data in ascending or descending order, click Sort A to Z or Sort Z to A.

How do I sort by Total in Google Sheets pivot table?

Within the Pivot table editor panel, click the dropdown arrow next to Sort by within the Rows section and choose SUM of Sales: What is this? The rows of the pivot table will automatically be sorted by the SUM of Sales column, ascending: What is this?

Why can't I sort my pivot table?

Refresh the pivot table. If the field which has items from a custom list is set for Automatic sort, it should change to the custom list's sort order. If the field is currently set for manual sorting, it won't sort according to the custom list order.

How do I sort a pivot table from largest to smallest?

Sort Based on Values.
First of all, select any cell in the Grand Total Column and Go to Home tab..
Further, click on Sort and Filter Under Editing..
After Clicking on the Sort & filter option, a drop-down list will appear..
Here you will find the required option” Sort Largest to Smallest”. ... .
Finally, the data is sorted..