Excel Pivot Table Sort by Another Column

Charts & pivot tables · Updated November 22, 2026

Yes, you can sort a pivot table by another column, but the method depends on what you mean by “another column.” If you want to sort the row labels by the values in a different value field (e.g., sort product names by total sales), use the field’s sort options or the value field’s sort button. If you want to sort by a column that is not part of the pivot table’s data (like a custom order list), you’ll need to add a helper column to your source data. This article explains both approaches, including how to sort by a value field, by a custom list, and by a calculated field.

Understanding Pivot Table Sorting Basics

By default, Excel sorts pivot table row labels alphabetically (A to Z) and value fields from largest to smallest. But you can change the sort order for any field. The key is knowing that sorting in a pivot table is tied to a specific field—either a row/column label field or a value field. When you sort by a value field, you’re telling Excel to reorder the rows based on the numbers in that value column. When you sort by a label field, you’re sorting alphabetically or by a custom list.

For example, imagine a pivot table with Product in Rows and Sales in Values. The default sort might show products alphabetically. To sort by sales (highest to lowest), you can right-click a sales cell, choose Sort, then Sort Largest to Smallest. That reorders the product names based on the sales numbers.

How to Sort by a Value Field (the Most Common Case)

The most frequent request is sorting row labels by a numeric column that appears in the Values area. Here’s the step-by-step for Excel 365 on Windows:

  1. Click anywhere inside the pivot table to activate the PivotTable Tools on the ribbon.
  2. Click on the Rows area field (e.g., “Product”) in the PivotTable Fields pane.
  3. Click the drop-down arrow next to the field name in the Rows area.
  4. Select More Sort Options….
  5. In the Sort dialog, choose Ascending or Descending.
  6. Under “Sort by,” select the value field you want to use (e.g., “Sum of Sales”).
  7. Click OK.

Alternatively, right-click any number in the Sales column, choose Sort, then Sort Largest to Smallest. This is faster but only works if you want to sort by that specific value field. On a Mac, the steps are the same (right-click or Control-click). In Excel for the web, right-click a value cell and choose Sort, or use the field’s drop-down.

Sorting by a Column That Isn’t a Value Field

Sometimes you want to sort by a column that is not summarized in the Values area—for example, a column of text like “Region” that you want to appear in a specific order (North, South, East, West). Excel’s default sort is alphabetical, which would give East, North, South, West. To get a custom order, you have two options:

  • Add a helper column in your source data with a numeric rank (e.g., 1 for North, 2 for South, etc.). Then add that helper column to the pivot table as a value field (e.g., as a sum or average) and sort by it. You can hide that value column afterward.
  • Use a custom list (Excel’s built-in sort order). Go to File > Options > Advanced > Edit Custom Lists (Windows) or Excel > Preferences > Custom Lists (Mac). Create a list like North, South, East, West. Then, in the pivot table, sort the row label field using More Sort Options > Manual and drag items, or use the custom list in the sort dialog.

For example, if you have a column “Priority” with values High, Medium, Low, and you want that order, create a custom list High, Medium, Low. Then right-click the row label, choose Sort > More Sort Options, and select the custom list.

Using the Sort by Value Dialog for Multi-Level Pivot Tables

When your pivot table has multiple row fields (e.g., Region then Product), sorting gets trickier. The “Sort by” dialog lets you choose which field to sort by. For instance, to sort each region’s products by sales, you’d select the Product field and sort by “Sum of Sales.” Excel will sort products within each region independently. If you want to sort the regions themselves by total sales, select the Region field and sort by “Sum of Sales.” Note that the sort applies to the selected field only, not to the entire table.

A common misconception is that sorting a value column will sort the entire pivot table. It only sorts the field you target. If you want to sort by a column that is not in the Rows or Columns area—say a calculated field—you can add that calculated field to the Values area and sort by it. For example, if you have a calculated field “Profit %” and you want to sort products by that percentage, add it as a value, then sort by that field.

Common Problems and Solutions

  • Sort options are grayed out: This happens when the field is in the Filters area or when the pivot table is in Compact Layout and you haven’t selected a cell in the row/column you want to sort. Click on a cell in the row label column first.
  • Sorting by a value field doesn’t work as expected: If you have multiple value fields (e.g., Sum of Sales and Count of Orders), the sort dialog may default to the first one. Use the “Sort by” dropdown to pick the correct field.
  • Custom list not appearing: Ensure the list is spelled exactly as in your data (case-insensitive) and that you’ve created it in Excel’s Custom Lists. Also, the custom list must be applied to the field’s sort options, not just the data.
  • Sort order changes when refreshing: Pivot tables remember sort settings, but if you add new items, they may appear at the end. To maintain a custom order, you may need to reapply the sort or use a helper column.

Sorting with Formulas and Dynamic Arrays

If you’re using Excel 365, you can bypass the pivot table entirely and use the SORT function to sort data by another column. For example, with data in A2:B20 (names in A, sales in B), you can use =SORT(A2:B20, 2, -1) to sort by sales descending. This returns a dynamic array. However, if you need a pivot table’s aggregation, you can create a pivot table and then use SORT on the pivot table’s output, but that’s rarely necessary.

For a calculated field in a pivot table, you can add it via PivotTable Analyze > Fields, Items & Sets > Calculated Field. For example, to create a “Profit” field with formula =Sales - Cost, then sort by that field. Note that calculated fields use the SUM of the underlying fields, so the formula works on totals.

Frequently Asked Questions

Q: How do I sort a pivot table by a column that isn’t in the pivot table?
A: You can’t directly sort by a column that isn’t part of the pivot table. You must add that column to your source data and then include it in the pivot table, either as a row label or a value field. For example, add a “Sort Order” column with numbers, then add it to the Values area (as Sum) and sort by that.

Q: Why does my pivot table sort alphabetically even after I sort by values?
A: This usually happens when you have multiple row fields and you only sorted one of them. Also, if you click a value cell and choose Sort, it sorts the row label field that corresponds to that value, but if you have a column label field, you might need to sort that separately. Check the “Sort by” dialog to ensure the correct field is selected.

Q: Can I sort by a custom list in a pivot table?
A: Yes. Create a custom list in Excel Options (Windows) or Preferences (Mac). Then, in the pivot table, right-click the row label, choose Sort > More Sort Options, and select “Manual” or use the custom list option. If the custom list doesn’t show, re-create it and ensure the spelling matches your data.

Q: How do I sort pivot table rows by a percentage column?
A: Add the percentage field to the Values area (it will appear as “Sum of Percentage” or similar). Then right-click any cell in that column, choose Sort, and select Largest to Smallest. The rows will reorder by that percentage. If the percentage is a calculated field, make sure it’s added correctly.

Q: Does sorting a pivot table affect the source data?
A: No. Sorting a pivot table only changes the display order in the pivot table. The underlying source data remains unchanged. This is one of the key benefits of pivot tables.

Q: Can I sort by multiple columns at once in a pivot table?
A: Not directly. Pivot tables allow sorting by one field at a time. To achieve multi-level sorting, you can sort by the first field, then manually reorder items within groups, or use a helper column that combines the sort keys (e.g., a concatenated string).

Conclusion and Best Practices

Sorting a pivot table by another column is straightforward once you understand that sorting is field-specific. Always use the field’s sort options for precise control. For custom orders, use a helper column or a custom list. Remember that pivot tables are dynamic—when you refresh, new items may break your sort order, so you may need to reapply sorts or use a stable helper column. For most users, right-clicking a value cell and choosing Sort is the quickest method. If you need to sort by a calculated field, ensure it’s added to the Values area first. With these techniques, you can control the order of your pivot table exactly as needed.

Related

Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.

More in Charts & pivot tables

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.