Pivot Sort by Grand Total: How to Sort Pivot Tables

Charts & pivot tables · Updated November 23, 2026

To sort a pivot table by its Grand Total column, right-click any cell in the Grand Total row or column, choose Sort, then select Sort Largest to Smallest or Sort Smallest to Largest. This reorders the row or column labels based on the summed values in the Grand Total, which is the most direct method in Microsoft Excel for Microsoft 365. For a more flexible approach, you can also use the Sort options in the field list or apply a manual sort, but the right-click method works in seconds and updates automatically when the pivot refreshes.

Why Sorting by Grand Total Is Useful

Pivot tables summarize large datasets, but the default alphabetical or source-order arrangement often hides the most important information. Sorting by Grand Total ranks categories by their overall contribution, so you can instantly see which product, region, or salesperson drives the most revenue. This is especially valuable for dashboards and reports where executives want the top performers at the top of the table without manually scanning hundreds of rows.

For example, if you have a pivot table with Product in Rows and Sales in Values, the Grand Total row at the bottom shows the sum for each product. Sorting by that row reorders the product names so the highest-selling product appears first. The same logic applies when you have multiple value fields (e.g., Sales and Profit) – you can choose which Grand Total column to sort by.

How to Sort by Grand Total (Step-by-Step)

Here is the exact process for Excel for Microsoft 365 on Windows. The steps are nearly identical on Mac, but the right-click menu may look slightly different.

  1. Click anywhere inside the pivot table to activate the PivotTable Tools.
  2. Locate the Grand Total row (if your pivot has row labels) or the Grand Total column (if it has column labels).
  3. Right-click on a cell that contains a value in the Grand Total row or column – for instance, the cell at the intersection of a row label and the Grand Total column.
  4. From the context menu, hover over Sort and then choose Sort Largest to Smallest or Sort Smallest to Largest.
  5. Excel immediately reorders the row or column labels based on the selected Grand Total values.

If you want to sort by a specific value field when multiple fields exist, right-click on the Grand Total cell that corresponds to that field. For example, if you have both Sales and Profit, right-click the Grand Total cell under the Profit column to sort by profit totals.

Alternative Sorting Methods

Beyond the right-click shortcut, Excel offers other ways to sort a pivot table:

  • Field List Sorting: In the PivotTable Fields pane, click the drop-down arrow next to a row or column field, then select More Sort Options. In the dialog, choose Descending (Z to A) by: and pick the value field you want to sort by. This method lets you specify a particular value field even if it isn’t the first one in the Values area.
  • Manual Sort: Drag a row label to a new position with the mouse. Excel disables automatic sorting for that field until you re-enable it. This is useful for custom orders (e.g., putting a “Miscellaneous” category last), but it overrides any automatic sort.
  • Sort from the Ribbon: Select a cell in the row or column label area, then go to Data tab > Sort group and use the A→Z or Z→A buttons. This sorts by the label text, not by values, so it’s not what you want for Grand Total sorting.

On Mac, the right-click menu is similar, but you may need to use Control+click to open the context menu if your mouse doesn’t have a right button.

Common Problems and Misconceptions

One frequent issue is that the Grand Total row disappears or is hidden. If you don’t see a Grand Total, go to the Design tab (under PivotTable Tools) and check the Grand Totals button. Ensure it is set to On for Rows and Columns or at least one of them. Without a Grand Total, you cannot sort by it directly.

Another misconception is that sorting by Grand Total will also sort the Values area. It does – but only the row or column labels that are part of the pivot’s layout. If you have multiple row fields (e.g., Region and Product), sorting by Grand Total will sort the outer field (Region) only, not the inner field (Product) within each region. To sort the inner field per region, you need to sort within each group, which Excel does automatically if you right-click on a value cell inside a group and choose Sort – but that sorts only that group, not the entire table.

A third issue: after refreshing the pivot, the sort order may be lost if you had manually dragged items. To keep a sort persistent, use the automatic sort options (right-click or field list) rather than manual dragging.

Sorting by Grand Total in Google Sheets

Google Sheets pivot tables work differently. In Google Sheets, you cannot right-click on a Grand Total cell to sort. Instead, you must use the built-in sort options in the pivot table editor. Click on the pivot table, then in the Rows or Columns section of the editor, click the drop-down arrow next to the field name. Choose Sort by and select the value field you want to sort by, then choose Descending or Ascending. This achieves the same result as sorting by Grand Total, because the sort is applied to the aggregated values. Note that Google Sheets does not have a separate “Grand Total” row in the same way; the totals are shown as a summary row, but sorting by the value field effectively sorts by that total.

When Sorting by Grand Total Does Not Work

There are a few scenarios where sorting by Grand Total may fail or produce unexpected results:

  • Multiple Row Fields: As mentioned, sorting applies to the outermost field only. To sort inner fields, you must sort each group separately or rearrange fields.
  • Calculated Fields: If your Grand Total includes a calculated field (e.g., Profit Margin), sorting by that total works, but be aware that the calculated field’s Grand Total may not be a simple sum – it’s computed from the underlying data, so the sort order might not match intuitive expectations.
  • Filtered Data: If you have a report filter applied, the Grand Total reflects only the visible data. Sorting will reorder based on that filtered total, which is usually what you want.
  • Compact vs. Outline Layout: In Compact layout, row labels are in a single column, and sorting works normally. In Outline or Tabular layout, sorting still works, but the visual grouping may make it harder to see the Grand Total row.

How to Sort by Grand Total with a Formula (Dynamic Approach)

If you need a dynamic sorted list that updates automatically without manual sorting, you can use the SORT function in Excel 365. This is useful when you want a separate report table that always shows the top categories by total. For example, assume your raw data has Product in column A and Sales in column B, with data in rows 2 to 100. To get a sorted list of products by total sales, you could use:

=SORT(UNIQUE(A2:A100), 2, -1)

But that formula sorts by the first column, not by totals. To sort by totals, you need to aggregate first. Use the following approach:

Assume you have a list of unique products in column D (you can create it with =UNIQUE(A2:A100)). Then in column E, calculate the total sales for each product with =SUMIF(A2:A100, D2, B2:B100). Finally, in column F, use =SORT(D2:E10, 2, -1) to get the products and totals sorted descending by total. This returns a dynamic array that updates when the source data changes. Note that SORT and UNIQUE require Excel 365 or Excel 2021.

This formula-based method gives you a live sorted list without touching the pivot table, which is handy for dashboards where you want to show the top 5 or 10 items.

Frequently Asked Questions

Why doesn’t my pivot table show a Grand Total?

By default, Excel shows Grand Totals for both rows and columns. If they are missing, go to the Design tab under PivotTable Tools, click Grand Totals, and select On for Rows and Columns. If you are using a pivot table with no row labels (only column labels), the Grand Total appears as a row at the bottom. If you have no values, there is nothing to total.

Can I sort by Grand Total when I have multiple value fields?

Yes. Right-click on the Grand Total cell that corresponds to the value field you want to sort by. For instance, if you have Sales and Profit, right-click the Grand Total cell under the Profit column to sort by profit. Alternatively, use the field list sort options and specify the value field.

Does sorting by Grand Total affect the underlying data?

No. Sorting a pivot table only changes the display order of the summary rows. It does not alter the source data or the calculations. The pivot table still references the same data range, and refreshing the pivot will maintain the sort order as long as you used an automatic sort.

How do I sort by Grand Total in Google Sheets?

In Google Sheets, click the pivot table, then in the pivot table editor under Rows or Columns, click the drop-down arrow next to the field name. Choose Sort by and select the value field (e.g., Sum of Sales), then choose Descending or Ascending. This sorts the labels by the aggregated totals, which is equivalent to sorting by Grand Total.

What if I want to sort only the top 5 items by Grand Total?

You can apply a value filter instead of sorting. In Excel, click the drop-down arrow on the row label field, choose Value Filters, then Top 10. Change the number to 5 and select the value field. This shows only the top 5 items, and you can then sort them by Grand Total using the right-click method. In Google Sheets, use the Filter option in the pivot editor to limit rows.

Why does my sort order reset after refreshing the pivot?

If you manually dragged items to reorder them, Excel treats that as a manual sort and may reset when you refresh or add new data. To keep a persistent sort, use the automatic sort options (right-click > Sort or field list sort). Manual sorting is only for one-time custom orders.

Related

Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.

More in Charts & pivot tables

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.