zaro

How Do I Sort a Table in a Pivot Table?

Published in Excel PivotTable Sort 3 mins read

Sorting data in a PivotTable is straightforward, allowing you to arrange your rows or columns alphabetically or numerically based on values.

Here's how to sort a column within your PivotTable:

Sorting by Label (Row or Column Items)

To sort the items listed in a row or column field (like product names, regions, etc.), you can use the standard sorting commands.

  1. Select a Cell: In the PivotTable, click any cell within the column or row labels that contains the items you wish to sort. For example, if you want to sort product names listed down the rows, click any cell in the 'Product' column within the PivotTable area.
  2. Go to the Data Tab: Navigate to the Data tab on the Excel ribbon.
  3. Click Sort: In the "Sort & Filter" group, click the Sort button.
  4. Choose Sort Order: Select the desired sort order:
    • Sort A to Z (Ascending)
    • Sort Z to A (Descending)

Reference Information Included: On the Data tab, click Sort, and then click the sort order that you want.

Sorting by Value (e.g., Sales Amount)

Often, you'll want to sort the labels (rows or columns) based on the values in the data area (like total sales, count of orders).

  1. Select a Cell in the Value Column: Click any cell within the column containing the values you want to sort by. For instance, if your rows list regions and you want to sort them by total sales, click a cell in the 'Sum of Sales' column corresponding to one of the regions.
  2. Go to the Data Tab: Navigate to the Data tab on the Excel ribbon.
  3. Click Sort: In the "Sort & Filter" group, click the Sort button.
  4. Choose Sort Order: Select the desired sort order:
    • Sort Smallest to Largest (Ascending for numbers)
    • Sort Largest to Smallest (Descending for numbers)

Reference Information Included: In the PivotTable, click any field in the column that contains the items that you want to sort. On the Data tab, click Sort, and then click the sort order that you want.

Additional Sort Options

For more advanced sorting criteria, such as sorting by a custom list or choosing which field and values to sort by when dealing with multiple fields, you can access additional options.

  • Accessing Options: After clicking the Sort button on the Data tab, look for the Options button in the Sort dialog box that appears (this may vary slightly depending on your Excel version and method of initiating the sort).

Reference Information Included: For additional sort options, click Options.

Using these steps, you can effectively arrange the data within your PivotTable to highlight trends, top performers, or other insights.