Sort Excel PivotTable Range Labels in Numeric Order
Question details
The user wants PivotTable range labels to appear in numeric order rather than alphabetical 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.
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.
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.
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.
Return to the PivotTable, right-click a cell inside it, and select Refresh to load the revised 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.

Sort labels by a numeric lower-bound field
Use a numeric helper field when you want to keep the original label text or need a more flexible long-term sort.
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. Open the workbook: In WPS Spreadsheets, select Open and choose the Excel workbook containing your PivotTable.
- 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. Refresh the PivotTable: Return to the PivotTable, right-click inside it, and select Refresh.
- 4. Sort the labels: Right-click a range label and choose the ascending sort option to put the padded labels in order.

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.




