Sort Month Numbers Correctly in an Excel PivotTable
Question details
The user needs to sort month values in chronological order 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.
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.
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.
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.
Click the PivotTable and choose PivotTable Analyze > Change Data Source. Extend the source range to include Numeric Month if it is not already included.
Right-click the PivotTable and select Refresh, then replace the original month field with Numeric Month in the PivotTable Fields pane.
Right-click a month number in the PivotTable and choose Sort > Sort Smallest to Largest. Check that the displayed months follow numerical order.

Sort month names with a Power Pivot calendar table
Use a calendar table when you want month names to appear in January-to-December order in a Data Model PivotTable.
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.

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.




