Applies To
Excel for Microsoft 365 for Mac Excel 2024 for Mac Excel 2021 for Mac

To help you locate data that you want to analyze in a PivotTable more easily, you can sort text entries (from A to Z or Z to A), numbers (from smallest to largest or largest to smallest), and dates and times (from oldest to newest or newest to oldest).

When you sort data in a PivotTable, be aware of the following:

  • Sort orders vary by locale setting. Make sure that you have the correct locale setting in Language and Text in System Preferences on your computer. For information about changing the locale setting, see the Mac Help system.

  • Data such as text entries may have leading spaces that affect the sort results. For optimal sort results, you should remove any spaces before you sort the data.

  • Unlike sorting data in a range of cells on a worksheet or in an Excel for Mac table, you can't sort case-sensitive text entries.

  • You can't sort data by a specific format, such as cell or font color, or by conditional formatting indicators, such as icon sets.

Sort row or column label data in a PivotTable

  1. In the PivotTable, select any field in the column that contains the items that you want to sort.

  2. On the Data tab, select Sort, and then select the sort order that you want. For additional sort options, select Options.

    Choose a sort order

    Text entries will be sorted in alphabetical order, numbers will be sorted from smallest to largest (or vice versa), and dates or times will be sorted from oldest to newest (or vice versa).

    Note: You can also quickly sort data in ascending or descending order by selecting A to Z or Z to A. When you do this, text entries are sorted from A to Z or from Z to A, numbers are sorted from smallest to largest or from largest to smallest, and dates or times are sorted from oldest to newest or newest to oldest.

Sort on an individual value

You can sort on individual values or on subtotals by right-clicking a cell, selecting Sort, and choosing a sort method. The sort order is applied to all the cells at the same level in the column that contains the cell.

Sort smallest to largest

In the example shown below, the data in the Transportation column is sorted smallest to largest.

Select a cell

To see the grand totals sorted largest to smallest, choose any number in the Grand Total row or column, and then select Sort > Largest to Smallest.

Select a total

Set custom sort options

To sort specific items manually or change the sort order, you can set your own sort options.

  1. Select a field in the row or column you want to sort.

  2. Select the arrow Filter drop-down arrow next to Row Labels or Column Labels.

    Choose custom criteria

  3. Under Sort, choose Ascending or Descending, and select from the options in the Sort by list. (These options will vary based on the your selections in steps 1 and 2.)

  4. Under Filter, select any other criteria you might have. For example, if you wanted to see the data for March only, in the By label list, select Equals and then type March in the text box that appears. To include only certain data in your calculations, select or clear the check boxes in the Filter box. To undo your selection, select Clear Filter.

    Limit results to one month

    Results from limiting sort to one month

  5. Select outside the custom sort dialog box to close it.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.