To sort a pivot table by the Sum column (e.g., Sum of Sales), click any cell inside that column’s values area, then use the small sort icons (A→Z or Z→A) on the PivotTable Tools > Data tab, or right-click the cell and choose Sort > Sort Largest to Smallest. This reorders the row labels based on the numeric values in that column, not alphabetically.
Why Sorting a Sum Column Can Be Confusing
In a regular Excel table, you select a column and click Sort on the Data tab. In a pivot table, that same approach often does nothing or sorts the row labels alphabetically. That’s because a pivot table’s sort is tied to the field you’re sorting, not the visible column. When you click a cell in the Sum of Sales column, Excel interprets that as “sort the Row Labels by this value field.” If you click a cell in the Row Labels column instead, you’ll get an alphabetical sort. Many users click the wrong cell and conclude the feature is broken.
How to Sort a Pivot Table by Sum (Step-by-Step)
These steps work in Excel for Microsoft 365 on Windows, and the same clicks apply on Mac (with minor ribbon differences):
- Click any single cell inside the Sum of Sales column (the values area). Do not select the whole column—just one cell.
- Go to the PivotTable Analyze tab (or Data tab in older versions).
- In the Sort group, click the Sort Largest to Smallest (Z→A) icon to sort descending, or Sort Smallest to Largest (A→Z) for ascending.
- Alternatively, right-click the same cell and choose Sort > Sort Largest to Smallest.
That’s it. The row labels reorder instantly. If you have multiple value fields (e.g., Sum of Sales and Sum of Profit), you must click a cell in the specific column you want to sort by—Excel sorts by the field that contains the active cell.
Sorting by a Sum Column When There Are Subtotals or Grand Totals
If your pivot table has subtotals (for example, each region shows a subtotal row), sorting by the Sum column will reorder the outer row labels based on their subtotal values. That usually works as expected. However, if you have a Grand Total row at the bottom, it stays at the bottom—it doesn’t get sorted along with the data. If you want the Grand Total to move, you’d have to hide it (Design tab > Subtotals > Do Not Show Subtotals) and then sort, but that’s rarely needed.
Common Problems and Fixes
- Sort icons are grayed out: You probably clicked a cell in the Row Labels area, not the values area. Click a number in the Sum column.
- Sorting by sum doesn’t stick after refreshing: Pivot tables remember the sort order, but if you add new items that fall before the current first item, they may appear at the end. To force a consistent order, use a custom list or apply a manual sort.
- Sorting by a calculated field: Works the same way—click any cell in that calculated field’s column and sort.
- Sorting by a sum that is text: If your values are stored as text (e.g., “$1,200” as a string), the sort will be alphabetical, not numeric. Convert the source data to real numbers (use the VALUE function or Text to Columns).
Using the Sort Options Dialog for More Control
For finer control—like sorting by a specific field that isn’t the active column—use the More Sort Options dialog:
- Right-click a cell in the Sum column, choose Sort > More Sort Options.
- Select Manual (you can drag items), Ascending (A to Z), or Descending (Z to A).
- Under Sort By, choose the value field you want (e.g., “Sum of Sales”).
- Check Summary to see what the sort will do, then click OK.
This dialog is also where you can sort by a different value field than the one you clicked—useful if your pivot has multiple value columns and you want to sort by Profit while looking at Sales.
Sorting by Sum in Excel for the Web and Mac
In Excel for the web, the process is identical: click a cell in the Sum column, then use the sort icons on the Data tab (or right-click > Sort). The Mac version uses the same ribbon tabs (PivotTable Analyze > Sort), though the icons may look slightly different. One difference: on Mac, the right-click menu says “Sort Largest to Smallest” exactly as on Windows. No special workaround is needed.
Alternatives: Sorting with a Pivot Chart or Power Pivot
If you need a more dynamic sort—like automatically showing the top 5 products—use a Value Filter instead: click the Row Labels drop-down arrow, choose Value Filters > Top 10, and set it to “Top 5” by Sum of Sales. That filters and sorts in one step. For advanced sorting across multiple columns, consider using Power Pivot with DAX, but that’s overkill for most users. A simpler alternative is to create a regular table (Ctrl+T) and use the SORT function (Excel 365) to reorder dynamically: =SORT(A2:B10, 2, -1) sorts by the second column descending. That formula requires Excel 2021 or 365.
Frequently Asked Questions
Why does my pivot table sort alphabetically instead of by sum?
Because you clicked a cell in the Row Labels column, not the Sum column. The sort applies to the field that contains the active cell. Click any number in the Sum of Sales column, then sort.
Can I sort by a sum column that is not the first value column?
Yes. Click any cell in the specific value column you want to sort by (e.g., Sum of Profit), then sort. If you want to sort by a field not displayed, use the More Sort Options dialog and change the “Sort By” field.
How do I sort by sum but keep the Grand Total at the bottom?
By default, the Grand Total row stays at the bottom regardless of sort order. If you want it to move, you’d have to hide it (Design tab > Grand Totals > Off) and then sort, but that’s unusual. Most users want the Grand Total fixed.
My sort order changes after I refresh the pivot table. How do I fix it?
Pivot tables try to remember sort order, but new items that appear before the first sorted item can throw it off. Use a custom list (File > Options > Advanced > Edit Custom Lists) to define a fixed order, or apply a manual sort and then lock it by setting the pivot table to “Sort manually” in the More Sort Options dialog.
Does sorting by sum affect the source data?
No. Sorting a pivot table only changes the display order of the pivot table; it never reorders or alters your original data range.
Related
- Generate Random Number SQL: RAND, NEWID, and More
- D Cell Battery Diameter: Exact Size & Specs
- Windows 10 Shortcut Keys: The Essential List
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Excel Pie Chart With Other Category: How to Group SlicesTo make an Excel pie chart with an Other category, select the data and choose Insert > Insert…
- Excel Gantt Chart: Build a Timeline from a Task ListYes. In Excel for Microsoft 365 on Windows, make a Gantt chart by putting task names, start dates,…
- Excel Chart: Remove Dates With No Data From the AxisTo remove dates with no data from an Excel chart, select the horizontal axis, open Format Axis, and…
- Doughnut Chart in Excel: Show PercentagesYes. In Microsoft Excel for Microsoft 365 on Windows, select your category names and values, choose Insert >…
- Adding a Slicer to a Pivot Table: Step-by-StepTo add a slicer to a pivot table in Excel, select any cell inside the pivot table, go…
- Excel Power Query Pivot Column: Steps and ExamplesTo pivot a column in Excel Power Query, select the column whose distinct values should become new headers,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.