How to Sort a Pivot Table in Excel? 6 Best Methods
Note: This tutorial on how to sort a pivot table in Excel is suitable for all Excel versions including Office 365.
Sorting is a very commonly used Excel feature that I am sure you have come across many times.
It is fairly straightforward to sort your data in an Excel spreadsheet. But, when it comes to sorting data inside a pivot table, things get very interesting.
This is because Pivot Table sorting has its own constraints and pitfalls. It is very easy to commit mistakes and end up in a confusing situation if one is not careful enough.
In this guide, I’ll walk you through the various methods and tricks to sort a pivot table in Excel.
- How to Sort a Pivot Table in Excel Using Labels?
- How to Sort a Pivot Table in Excel by Values?
- Sorting a Pivot Table with Multiple Category Fields
- How to Fix If Newly Added Pivot Table Items are Out of Order?
- How to Fix if the Pivot Table Report Filter is Out of Sort Order?
- How to Sort the Pivot Table Horizontally?
- Closing Thoughts
Related:
How to Autofit Excel Cells? 3 Best Methods
How to Add Subscript in Excel? (6 Best Methods)
How to Delete a Pivot Table in Excel? 4 Best Methods
How to Sort a Pivot Table in Excel Using Labels?
It is straightforward to sort a Pivot Table using labels in alphabetical order. All you need to do is to follow these steps:
- Click on any cell in the Pivot Table field based on which you need to sort.
- Click on the Alphabetical Sort option (AZ or ZA for ascending or descending respectively) inside the Data tab.


Your entire pivot table will be sorted based on the alphabetical order of the column you just selected.
How to Sort a Pivot Table in Excel by Values?
In case you want to sort your Pivot table using a value field, follow these steps:
- Click on any cell in the value field of your Pivot Table based on which you need to sort.
- Click on the Sort option inside the Data Tab and choose whether you want to sort from the smallest to largest values or vice versa. You can also use the Alphabetical sort option here.


Now, the Pivot Table will be sorted based on the numerical values of the pivot table field you just selected.
Also Read:
How to Add Error Bars in Excel? 7 Best Methods
How to Enable Excel Dark Mode? 3 Simple Steps
How to Group Worksheets in Excel? (In 3 Simple Steps)
Sorting a Pivot Table with Multiple Category Fields
Here is an interesting feature to note about Pivot Table sorting. If you have multiple category fields in the pivot table, the data will be sorted only inside and after the subcategories you selected for sorting.
The sorting will not be applied to the entire Pivot Table. Hence, it is always important to pay attention not only to the field you are selecting for sorting but also to the sub-category you are trying to sort.




This is not a bug rather, it is a feature of the Pivot table.
Similarly, any field will be sorted independently for the category and subcategories of the pivot table.


How to Fix If Newly Added Pivot Table Items are Out of Order?
Sometimes, if you add new rows of data to the Pivot Table source, they will not appear in the correct sort order in the Pivot table. If this persists even after refreshing the pivot table, you can try the following steps:
- Right-click on any cell in the Pivot Table field, based on which you want to sort.


- Choose an Ascending or Descending sort order.
This will change the sorting mode of the Pivot table to the automatic mode from manual mode. Thereafter, all the newly added items will be sorted automatically based on the sorting preference.
How to Fix if the Pivot Table Report Filter is Out of Sort Order?
The same problem might occur with the report filter of the Pivot Table. That is the newly added items of the Pivot Table will not appear in the correct sort order inside the report filter drop-down menu.
This is because the default sorting mode is set to manual, as seen before.
To fix this, follow these steps:
- Temporarily drag the filter field to the values field in the Pivot Table values pane.
This is because you cannot sort them unless they are in the values field.
- Right-click on any cell in the Pivot Table field based on which you want to sort.
- Choose an Ascending or Descending sort order.
- Move the field back to the filter field in the Pivot Table values pane.
This will change the sorting mode to automatic. The new items will appear in the correct sort order inside the filter drop-down menu.
How to Sort the Pivot Table Horizontally?
Sometimes, you may need to sort the pivot table horizontally from left to right. To do this, follow these steps.
- Right-click on any cell in the row, based on which you want to sort horizontally.
- Under Sort, choose More Sort Options.
- Click on ‘Left to Right’ under sort direction in the Sort by Values dialogue box.


- Choose the sort order e.g. ‘Smallest to Largest’ or vice versa.


This will sort the Pivot Table in the horizontal direction. Note that the sort order applies only to the row you selected and not to the entire Pivot Table.
Suggested Reads:
The Excel CHOOSE Function – 4 Best Uses
The FORMULATEXT Excel Function – 2 Best Examples
How to Make a Line Graph in Excel? 4 Best Line Graph Examples
Closing Thoughts
That’s everything about how to sort a pivot table in Excel. Test these methods in a practice worksheet and feel free to ask any questions or doubts you may have in the comments section.
If you like this guide and want more high-quality tutorials on Excel check out our free Excel resources centre.
Ready to take the next step and hone your skills in Excel?
Simon Sez IT has been teaching Excel for over ten years. For a low, monthly fee you can get access to 100+ IT training courses. Click here for advanced Excel courses with in-depth training modules.