Pivot Table Issues

Sort Excel PivotTable Range Labels in Numeric Order

Camila MilosovichCamila Milosovich Dec 2, 2026 869 views

Question details

The user wants PivotTable range labels to appear in numeric order rather than alphabetical order.

Sort Excel PivotTable Range Labels in Numeric Order
Product
Microsoft Excel
Device & OS
not provided
Scenario
A PivotTable groups data using range labels such as 1-2 and 10-19.
Observed behavior
Excel treats the labels as text, so their alphabetical order may not match the intended numeric order.
Before you start

Find the source data column that contains the range labels and check the largest number of digits used in each bound. If the PivotTable uses an external source, make sure you can edit that source before refreshing.

Solution 1Recommended

Use zero-padded labels in the source data

Use this approach when you can change the displayed range labels and want a simple alphabetical sort to match numeric order.

1
Edit the source labels

In the PivotTable's source data, change labels such as 1-2 and 3-4 to 01-02 and 03-04. Use the same number of digits for each corresponding bound across all labels.

2
Refresh the PivotTable

Return to the PivotTable, right-click a cell inside it, and select Refresh to load the revised labels.

3
Sort the labels

Right-click a range label and select Sort > Sort A to Z. Labels such as 01-02, 03-04, and 10-19 should now appear in the intended order.

Use zero-padded labels in the source data
Choose enough digits: If a lower or upper bound can contain three digits, pad all values in that position to three digits, such as 001-002.
Work with PivotTables in WPS Office

Sort range labels in WPS Spreadsheets

Open your workbook in WPS Spreadsheets, standardize the source labels with leading zeros, and refresh and sort the PivotTable.

  1. 1. Open the workbook: In WPS Spreadsheets, select Open and choose the Excel workbook containing your PivotTable.
  2. 2. Standardize the labels: Go to the source data sheet and change labels such as 1-2 to 01-02, using consistent digit widths across the ranges.
  3. 3. Refresh the PivotTable: Return to the PivotTable, right-click inside it, and select Refresh.
  4. 4. Sort the labels: Right-click a range label and choose the ascending sort option to put the padded labels in order.
Sort padded PivotTable range labels in the intended orderOpen and edit Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interfaceWork with spreadsheets for free
QA img-9

Frequently Asked Questions

Why does 10-19 appear before 1-2 in my PivotTable?

Range labels containing hyphens are text, so Excel sorts them alphabetically rather than by their numeric bounds. Use consistent leading zeros or sort by a numeric helper field.

How many leading zeros should I use?

Use enough digits for the largest bound in each position. For example, if lower bounds reach 100, use three digits for all lower bounds, such as 001 and 010.

Can I keep labels such as 1-2 without adding zeros?

Yes. Add a numeric lower-bound column to the source data, refresh the PivotTable, and sort the labels by the minimum lower-bound value.

Why do the old labels still appear after I edit the source?

The PivotTable may not have refreshed. Right-click inside it and select Refresh. If a new helper column is missing, check PivotTable Analyze > Change Data Source to make sure the column is included.