Pivot Table Issues

Sort Month Numbers Correctly in an Excel PivotTable

Khadija KhanKhadija Khan Nov 27, 2026 868 views

Question details

The user needs to sort month values in chronological order in an Excel PivotTable.

Sort Month Numbers Correctly in an Excel PivotTable
Product
Microsoft Excel PivotTable and Power Pivot
Device & OS
not provided
Scenario
A PivotTable uses a month field from source data to display or filter records.
Observed behavior
Month numbers are sorted as text, producing an order such as 1, 10, 11, 12, 2, 3. Applying number formatting to the source cells may not change the underlying field type.
Before you start

Check whether the source month values are stored as text or numbers, and identify the date column if you plan to use a calendar table. For the Power Pivot method, make sure Power Pivot is available and the source data can be added to the Data Model.

Solution 1Recommended

Convert the source month values to numbers

Use this method when you only need month numbers in the PivotTable and the source values are stored as text.

1
Add a numeric month column

In the source worksheet, add a column named Numeric Month. In its first data row, enter a formula such as =IFERROR(VALUE(A2),"") using the cell that contains the original month, then fill the formula down.

2
Include the new column

Click the PivotTable and choose PivotTable Analyze > Change Data Source. Extend the source range to include Numeric Month if it is not already included.

3
Refresh the PivotTable

Right-click the PivotTable and select Refresh, then replace the original month field with Numeric Month in the PivotTable Fields pane.

4
Sort the month field

Right-click a month number in the PivotTable and choose Sort > Sort Smallest to Largest. Check that the displayed months follow numerical order.

Convert the source month values to numbers
Formatting alone is not conversion: Changing a cell's number format does not necessarily convert text to a number. Check any blank results in the helper column for invalid source values.
Free Microsoft Office alternative

Work with spreadsheet data in WPS Office

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface. Open compatible Excel files and continue working with your data as you migrate; it does not repair an Excel Power Pivot Data Model.

Work with month data in a familiar spreadsheet interfaceCompatible with Microsoft Excel XLSX and XLS formatsFree and lightweight for everyday office tasksOpen existing spreadsheets to make migration easier
microsoft office alternative - wps office

Frequently Asked Questions

Why does my PivotTable put 10 before 2?

The month values are likely being treated as text, so Excel sorts them alphabetically. Convert the source values to numbers, refresh the PivotTable, and sort the numeric field from smallest to largest.

Why didn't changing the number format fix the sort order?

Number formatting changes how a value looks, not necessarily how it is stored. Use a helper formula such as =VALUE(A2) to convert a text month to a number, then refresh the PivotTable.

How can I show month names in calendar order?

In Power Pivot, select the calendar table's Month Name column and use Sort by Column with Month Number. Then use Month Name from that table in the Data Model PivotTable.

What if the new month column doesn't appear in PivotTable Fields?

Click the PivotTable and choose PivotTable Analyze > Change Data Source to include the new column, then right-click the PivotTable and select Refresh.