Sheet Clinic

Sort by month in a Google Sheets pivot table, not A to Z

A pivot of month names sorts Apr, Feb, Jan. To sort by month, drag the labels into a Custom order or group by a key column like 01 Jan.

Sheet Clinic editorsPublished
F1Rows: Month (Order Ascending) · Columns: Priority (Order Ascending) · Values: SUM of Sales

Before as Sheets built it

FGHIJ
2MonthHighLowMediumGrand Total
3Apr13202759002495
4Feb98030011002380
5Jan12004008502450
6Jun16006109803190
7Mar19506507003300
8May105052012402810
9Grand Total81002755577016625

What changed

  1. Jan, Feb, Mar and May dragged up
  2. Medium dragged left of Low

After five drags, Order is Custom

FGHIJ
2MonthHighMediumLowGrand Total
3Jan12008504002450
4Feb98011003002380
5Mar19507006503300
6Apr13209002752495
7May105012405202810
8Jun16009806103190
9Grand Total81005770275516625
Figure 1. The same pivot on the Broken and Fixed tabs.

A Google Sheets pivot table lists month names as Apr, Feb, Jan when the months are typed as text, because Ascending order for text is alphabetical. To sort by month in calendar order, drag each month label to its place inside the pivot, which turns the Order box in the editor to Custom, or group the pivot by a key column such as 01 Jan that already sorts correctly under Ascending. Dragging is faster. Key columns keep their order because it comes from the data.

Jan brought in 2450 across the three priorities, and in the pivot on the Broken tab that row sits third, under Apr and Feb. The full list reads Apr, Feb, Jan, Jun, Mar, May, and the priority columns run High, Low, Medium. The Grand Total of 16625 matches column D of the data. The order is the only problem, and it is plain alphabetical order.

B2:B20 holds words. Jan, Feb and the rest were typed as text, so the pivot has no idea they are months. It sees six short labels and lines them up A to Z. Priority is sorted by the same rule, which is how Low ends up between High and Medium. Text dates in a plain column go wrong the same way, as covered in Google Sheets not sorting dates correctly.

Why Apr lands above Jan in this pivot

Click any cell in the pivot and a small pencil button appears under it. That opens the pivot table editor. Under Rows, the Month field has two boxes. Order says Ascending, and Sort by says Month. For a text field, Ascending means alphabetical. Priority, under Columns, has the same two settings.

Open the Order box and you get Ascending, Descending and Custom. The first two can only give you A to Z or Z to A. Custom is the one that holds a hand-made order, and its line in the menu says how to get it, To custom sort, drag and drop a cell into your preferred order. The drag happens on the pivot itself, on the grid.

The Broken tab with F3 selected. The formula bar shows Apr. The pivot in F1:J9 lists Apr, Feb, Jan, Jun, Mar, May down column F and High, Low, Medium across row 2, with a Grand Total of 16625.
Figure 2. The Broken tab. Months and priorities are both in A to Z order.

Three versions of the same sales pivot, side by side

All three tabs hold the same data in A2:D20 and a pivot with SUM of Sales in the middle. The table lists what each one shows and which setting sits in its Order box.

Broken tabFixed tab (dragged)Key columns tab
Row labelsApr, Feb, Jan, Jun, Mar, MayJan, Feb, Mar, Apr, May, Jun01 Jan to 06 Jun
Column labelsHigh, Low, MediumHigh, Medium, Low1 High, 2 Medium, 3 Low
Order box for MonthAscendingCustomAscending
Jan row total and Grand Total2450 and 166252450 and 166252450 and 16625

Correcting the month order with four drags on the Fixed tab

Google's page on customizing a pivot table says you can reorder row or column breakouts by dragging and dropping them in the pivot table, and that the editor then shows the order for that breakout as Custom.

  1. Click the label you want to move. For the first move that was Jan, in F5.
  2. Point at the edge of the blue box around the cell until the pointer becomes a grabbing hand.
  3. Hold the button and drag the cell up onto the row it should take. Jan went onto Apr in F3.
  4. Let go. Jan landed in F3, and Apr and Feb each moved down a row.

Each drop puts the label above the row you drop it on, so you never swap two rows by hand. From Apr, Feb, Jan, Jun, Mar, May it took four moves to reach Jan through Jun. Jan went onto Apr, then Feb onto Apr, then Mar onto Apr, and last May onto Jun.

Columns move the same way, sideways. Medium sat in I2, to the right of Low. Dragging it onto Low in H2 gave High, Medium, Low, and the Medium figures came along with the header, 5770 at the bottom.

Aim for a label cell inside the same block. The first attempt on this tab dropped Jan a little too high, on the Month header in F2, and Sheets refused with a message at the bottom of the window, Can't drop cells here. Use the editor to change headers. Nothing moved. Google lists a few more limits on the same page. A row label can't be dropped into the value area, a label can only move within its own level when there are nested row groups, and if the block has no room to land, the cells go back where they were.

The Fixed tab with F3 selected. The formula bar shows Jan. The pivot lists Jan, Feb, Mar, Apr, May, Jun down column F and High, Medium, Low across row 2. Jan reads 1200, 850, 400 and 2450.
Figure 3. The Fixed tab after five drags. The labels are in calendar and priority order.

Month key and Priority key columns the pivot sorts on its own

The Key columns tab adds two helper columns, E and F, between the data and the pivot. Each key starts with a number, so plain Ascending order already comes out right. The pivot moved to H1 when the two columns were inserted, and it groups by the keys instead of by Month and Priority.

E2 holds the month key.

=ARRAYFORMULA(TEXT(MONTH(B2:B20&" 1"),"00")&" "&B2:B20)

MONTH needs a date. Adding a space and a 1 to each label turns Jan into the text Jan 1, which this sheet, set to the United States locale, reads as a date. MONTH returns 1, TEXT with the pattern "00" writes it as 01, and the label is joined back on. E2 shows 01 Jan, and the April rows show 04 Apr. The leading zero keeps the keys in order once the data reaches October. Without it, October's key would start with a 1 and sort ahead of February's 2.

F2 holds the priority key.

=ARRAYFORMULA(MATCH(C2:C20,{"High","Medium","Low"},0)&" "&C2:C20)

MATCH looks each priority up in the list in braces and returns its position. High becomes 1 High, Medium 2 Medium, and Low 3 Low.

Then point the pivot at the new columns. The range box sits at the very top of the pivot table editor, above Suggested, with a small grid icon at its right end. On this tab it reads 'Key columns'!A1:F20, wide enough to take in the two key columns. Under Rows, remove Month with its X and add Month key. Under Columns, take Priority out and add Priority key. Both Order boxes still say Ascending, and 01 Jan reads 1200, 850, 400 and 2450.

There are two costs. The pivot shows 01 Jan instead of Jan, which is fine in a working sheet and less nice in a report. And both formulas and the pivot's data range stop at row 20.

The Key columns tab with E2 selected. The formula bar shows =ARRAYFORMULA(TEXT(MONTH(B2:B20&" 1"),"00")&" "&B2:B20). Column E reads 01 Jan, 01 Jan, 01 Jan, 02 Feb; column F reads 1 High, 2 Medium, 3 Low. The pivot in H1:L9 lists 01 Jan to 06 Jun and 1 High, 2 Medium, 3 Low.
Figure 4. The Key columns tab. The pivot is still set to Ascending and comes out in calendar order.
Input19 sales rows in A2:D20 (Rep, Month, Priority, Sales)
FormulaPivot at F1: Rows Month, Columns Priority, Values SUM of Sales, Order Custom
ExpectedJan, Feb, Mar, Apr, May, Jun
Sheets returnedJan, Feb, Mar, Apr, May, Jun Matches expected
Checked2026-11-11, free personal account

After a drag, the Order box says Custom

After a drag, the editor shows Custom in the Month field's Order box, and Sort by still says Month. Nothing in the source data changed, so the order lives only in that one setting.

The same Order box still lists Ascending and Descending above Custom. Ascending is the setting that put the Broken tab's labels in A to Z order, Apr first.

For a summary you finish once and send, dragging is quick and leaves the labels exactly as they are in the data. If you would rather have the order come from the data itself, use key columns, which sort correctly under plain Ascending.

Try it yourself: rewrite E2 and F2

The Try it yourself tab has the key-column layout with keys that do nothing. Its pivot already groups by Month key and Priority key, but E2 holds =ARRAYFORMULA(B2:B20) and F2 holds =ARRAYFORMULA(C2:C20). The keys are plain copies of the month and the priority, so the pivot in H1 shows the same Apr, Feb, Jan order as the Broken tab.

The shared sheet is view only, so make your own copy first with the button at the end of this page. Then replace E2 and F2 with the two key formulas shown earlier and compare H2:L9 with the same range on the Key columns tab. The labels and every figure should match. The Broken tab in your copy is a good place to practice the drag as well.

Google's pivot table basics page covers opening the editor and adding fields, if the Rows and Columns sections are new to you. The same editor also holds the Values section, where pivot table calculated fields are added.

With both keys rewritten, H3 on the Try it yourself tab reads 01 Jan and L3 reads 2450.

Take-home copy. Four tabs: Broken (as you see it), Fixed, Try it yourself, Key columns. It opens as a copy in your own Drive.

Copy the sheet