How to Sort a Pivot Table in Excel by Labels and Values

What is a Pivot Table?

pivot table is an essential Excel feature that enables users to easily organize and summarize complex data.

This feature allows users to group their data by columns, sort it by values, and calculate statistics.

In addition to that, pivot tables are very useful when you have a large quantity of data.

Now that we already have an understanding of the pivot table, let’s finally move on to the tutorial on how to sort data in a pivot table in Excel.

How to Sort a Pivot Table in Excel by Labels

When sorting a pivot table by labels or alphabetically, you can either sort them from A to Z or Z to A, or in ascending or descending order. Learn the simple steps below.

  1. Click on pivot data, then click sort and filter.


    First, click on any of the pivot data, then click the sort and filter feature in the editing group in Home.

    Sort and Filter

  2. Select from sort A to Z or sort Z to A.


    After clicking the “sort and filter” button, you’ll see three options. Sort A to ZZ to A, and custom sort.

    ● Click sort A to Z if you want your data to be sorted in ascending order.
    ● Click sort Z to A if you want your data to be sorted in descending order.
    ● Click the custom sort option if you want to customize your data yourself.

    Sort Options

Note: Upon clicking the custom sort option, a sort dialog box will appear (see image below).
Sort Dialog Box

How to Sort a Pivot Table in Excel by Values

When sorting a pivot table by values, you can either sort them from smallest to largest or from largest to smallest.

Learn the simple steps below.

First Step: Click the value on the data you want to sort.

Second Step: Click the sort and filter feature in the editing group in Home.

Sort and filter value

Third Step: Select “sort from smallest to largest” or “sort from largest to smallest.”

After clicking the “sort and filter” button, you’ll see three options. Sort smallest to largestlargest to smallest, and custom sort.

  • Click Sort Smallest to Largest if you want your data to be sorted from smallest to largest.
  • Click Sort Largest to Smallest if you want your data to be sorted from largest to smallest.
  • Click the Custom Sort option if you want to customize your data yourself.
Sort Options Value - How To Sort A Pivot Table In Excel By Labels And Values

Note: Upon clicking the custom sort option, a sort-by-value dialog box will appear. There, you'll see sort options and sort directions (see the image below).
Sort by Value Dialog Box - How To Sort A Pivot Table In Excel By Labels And Values

Conclusion

In conclusion, sorting a pivot table in Excel makes us easily organize and analyze our data. Learning how to do it is an easy thing to do. You just follow the simple steps in the tutorial above, and you’re good.

I believe that we have accomplished this tutorial. I hope you’ve learned something from this. Do not forget to share this with your friends.

Thank you for reading! If you have any questions or suggestions, please leave a comment below.

What changed for PivotTable sorting in 2026

The 2026 Excel update added a Suggest sort order option in the right-click context menu of a PivotTable cell. Right-click any value cell and Copilot proposes 2 to 3 sort orders that match common reporting patterns (for example, largest revenue first, then alphabetical by region). Click a suggestion to apply and lock it.

Excel also improved manual sort persistence. In earlier versions, dragging a row label to reorder items was lost on the next data refresh unless you enabled Sort Automatically. In the 2026 update, manual reorders are stored in the PivotTable definition and survive refreshes by default, unless the source data introduces new items that were not in your manual sort list.

Common sort pitfalls

  • Sort not working on a grouped date field. Ungroup first (right-click the date field, choose Ungroup), sort the underlying dates, then regroup by month or quarter.
  • Numbers sorting as text. If 10 appears before 2 in your sort, the source column has numbers stored as text. Convert them with Data > Text to Columns > Finish, then refresh.
  • Custom sort resets after refresh. Open the field arrow, choose More Sort Options, and check Sort automatically every time the report is updated. Then pick your sort field and direction.
  • Sorting hides subtotals. If a Compact Layout row label is sorted, the subtotals may stack unexpectedly. Switch to Outline or Tabular layout (Design tab > Report Layout) for cleaner sorted output.

Sorting by a Custom List

Excel Custom Lists (for example, weekdays or months) apply automatically to PivotTable row labels. If your row label contains days of the week, Excel sorts Monday to Sunday by default, not alphabetically. To add your own custom sort order (for example, product tiers: Bronze, Silver, Gold, Platinum), go to File > Options > Advanced > General > Edit Custom Lists, enter your order, and PivotTable rows sort by that list.

Quick step-by-step summary (click to expand)
  1. Click the field header Click the small dropdown arrow next to the row or column label you want to sort.
  2. Choose sort order Pick Sort A to Z (or Sort Smallest to Largest) or Sort Z to A. The PivotTable re-orders immediately.
  3. Sort by a value field To sort rows by a value column, click a cell in that value column, right-click, and choose Sort > Sort Largest to Smallest.
  4. Apply a custom sort order Click the field arrow, choose More Sort Options, pick Manual (you can drag items to reorder) or Sort by a value field.
  5. Lock the sort for future refreshes In More Sort Options, tick Sort automatically every time the report is updated so refreshes do not reset your order.

Frequently Asked Questions

Why does my Pivot Table sort reset after refresh?

Manual sorts and value sorts reset when the source data introduces new items. Fix this by opening More Sort Options and enabling Sort automatically every time the report is updated.

How do I sort a Pivot Table by a value that is not in the row?

Click a cell in the value column you want to sort by, right-click, choose Sort, then Sort Largest to Smallest or Sort Smallest to Largest. The rows re-order by that value.

Can I sort multiple levels of a Pivot Table hierarchy?

Yes. Sort the innermost field first (deepest indent), then work outward. Each sort applies within the parent group above it.

How do I sort dates chronologically in a Pivot Table?

Right-click a date cell, choose Sort, then Sort Oldest to Newest. If dates appear as text, convert them to real dates in the source with =DATEVALUE(A2), then refresh.

Can Copilot suggest a Pivot Table sort order?

Yes. Right-click any value cell in a 2026 Excel PivotTable and choose Suggest sort order to see Copilot recommendations.

How do I clear a sort and return to source order?

Click the field arrow, choose More Sort Options, and select Data Source Order. The PivotTable reverts to the order rows appear in your source data.

Elijah Galero

Programmer & Technical Writer at PIES IT Solution

Elijah Galero is a programmer and writer at PIES IT Solution, author of 175+ tutorials at itsourcecode.com. Specializes in Python error debugging (AttributeError, TypeError, ModuleNotFoundError), Python programming tutorials, and Microsoft Excel how-to guides for BSIT students and productivity learners.

Expertise: Python · Python Errors · Python AttributeError · Python TypeError · ModuleNotFoundError · MS Excel · MS PowerPoint  · View all posts by Elijah Galero →

Leave a Comment