How to Sort Excel Slicer Buttons Numerically
Question details
Users need to sort Excel slicer buttons in numerical order, but the default alphabetical sorting causes mixed text-and-number labels to sort incorrectly.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Organizing data dashboard filters or PivotTable slicers where categories contain numerical values.
- Observed behavior
- Excel slicers sort items alphabetically by default, causing labels like 'Goal 1', 'Goal 10', and 'Goal 2' to appear out of true numerical sequence.
Ensure you have access to edit the original source data of your PivotTable, as modifying the source values is often the most reliable way to fix slicer sorting issues.
Format Labels with Leading Zeros
Adjust the labels in your source dataset to have consistent character lengths by adding leading zeros. This ensures alphabetical sorting perfectly matches numerical order.
Because Excel treats mixed alphanumeric labels as text, it sorts them character by character. To force 'Goal 1' to appear before 'Goal 10', you must format it as 'Goal 01'.
Navigate to the spreadsheet containing the raw data source for your PivotTable and Slicer.
Locate the column used for the Slicer and edit the single-digit entries by adding a leading zero (e.g., change 'Goal 1' to 'Goal 01', 'Goal 2' to 'Goal 02').
Right-click anywhere inside the PivotTable connected to the Slicer and select 'Refresh'.
Check your Slicer buttons. They will now align in standard numerical order based on the new two-digit formatting.
Create and Apply a Custom Sort List
Define a specific order for your Slicer labels using Excel's Custom Lists feature without altering the original source text.
Pad Labels with Extra Spaces
A quick visual workaround involves adding hidden spaces inside the text labels to manipulate the alphabetical sorting logic.
Sort and Filter Data Seamlessly with WPS Spreadsheet
WPS Spreadsheet offers powerful data visualization tools, including highly customizable Slicers and PivotTables, completely free. You can easily manage data sorting, apply custom lists, and maintain perfect compatibility with your existing Excel files.
- 1. Open Your Data: Launch WPS Spreadsheet and open your existing data file.
- 2. Insert PivotTable: Highlight your data, navigate to the 'Insert' tab, and click 'PivotTable'.
- 3. Add a Slicer: Click anywhere in the generated PivotTable, go to the 'Options' tab under PivotTable Tools, and click 'Insert Slicer'.
- 4. Sort Easily: Select the field you wish to filter. You can easily modify source data formatting or use WPS's custom list sorting to arrange your buttons perfectly.

Frequently Asked Questions
Why does Excel sort '10' before '2' in a Slicer?
Slicers treat labels as text and sort them alphabetically rather than by their numerical value. In alphabetical sorting, the character '1' in '10' comes before '2', causing the unexpected order.
Can I manually drag and drop Slicer buttons to rearrange them?
No, Excel does not allow manual drag-and-drop rearranging of Slicer buttons. The order is strictly determined by the alphabetical sorting rules or an applied Custom Sort List.
Do I have to change my source data to fix slicer sorting?
Not necessarily. While altering source data (like adding leading zeros) is the most permanent fix, you can also avoid touching source data by creating a Custom Sort List in Excel's Advanced Options.




