This tutorial explains how to sort Pivot Table columns in a custom order in Google Sheets. Since Google Sheets doesn’t provide a built-in option for custom column sorting, you’ll use a helper column to control the order of the Pivot Table field values.
If you’re not familiar with the built-in sorting options, first see How to Sort a Pivot Table by Value in Google Sheets.
With that covered, let’s look at the steps.
Sample Data and Setup
To sort Pivot Table columns in a custom order, we must first define the desired order using a helper column.
The helper column controls the custom sort order without appearing as a separate field in the final Pivot Table.
If you plan to insert the Pivot Table on the same sheet, I recommend leaving two empty rows above the sample data.
Assume you have the following data in the range A3:D10:
| Project | Manager | Status | Hours |
|---|---|---|---|
| Alpha | Sona | In Progress | 18 |
| Beta | Karan | Completed | 12 |
| Gamma | Olivia | On Hold | 9 |
| Delta | Keerthi | In Progress | 15 |
| Epsilon | Neha | Completed | 20 |
| Zeta | Sophia | On Hold | 7 |
| Eta | Alex | In Progress | 11 |
Our goal is to display the Status columns in the order In Progress → On Hold → Completed. However, if you create a Pivot Table with Project in Rows, Status in Columns, and Hours in Values, Google Sheets displays the columns in the default order Completed → In Progress → On Hold.
Creating a Helper Column to Define the Custom Sort Order
To sort the Status column in a custom order, enter the following formula in cell E3, next to the sample data:
=ARRAYFORMULA(
VSTACK("",
IFNA(
XMATCH(
C4:C,
VSTACK("In Progress", "On Hold", "Completed")
)
)
)
)
The helper formula uses open-ended ranges, so it automatically includes new rows added to the source data.

The formula assigns the following sort positions:
- In Progress → 1
- On Hold → 2
- Completed → 3
The header is intentionally left blank so that no helper column heading appears above the Pivot Table.
XMATCH matches each value in C4:C against the custom order defined in VSTACK("In Progress", "On Hold", "Completed") and returns its position (1, 2, or 3).
Note: Include all unique values from the Status column in the VSTACK array, in the exact order you want them to appear in the Pivot Table.
Create the Pivot Table
When creating the Pivot Table, include the helper column in the source data range.
Select A3:E10, then click Insert > Pivot table.
Choose Existing sheet, enter G1 as the location, and click Create.
In the Pivot Table editor:
- Click Add next to Rows and add the Project field.
- Click Add next to Columns and add the Status field.
- Click Add next to Values and add the Hours field.
This creates the following Pivot Table with the default column order:
| Project | Completed | In Progress | On Hold | Grand Total |
|---|---|---|---|---|
| Alpha | 18 | 18 | ||
| Beta | 12 | 12 | ||
| Delta | 15 | 15 | ||
| Epsilon | 20 | 20 | ||
| Eta | 11 | 11 | ||
| Gamma | 9 | 9 | ||
| Zeta | 7 | 7 | ||
| Grand Total | 32 | 44 | 16 | 92 |
Notice that the columns appear in the order Completed → In Progress → On Hold.
To display them in our custom order, follow these steps:
- Click Add next to Columns and add Column E. Since the helper column has no header, it appears as Column E.
- Drag Column E above the Status field in the Columns section.
Google Sheets first groups the columns by the helper values (1, 2, and 3), then displays the corresponding Status labels in that order. - In the Status field settings, uncheck Show totals.

- Hide row 2 by right-clicking the row number and selecting Hide row.
The Pivot Table columns will now appear in the order In Progress → On Hold → Completed.
Final Pivot Table with Columns in Custom Order
After hiding row 2, the Grand Total column heading is also hidden. To restore it, enter the following formula in cell L3 (the next empty cell to the right of the Pivot Table header row):
="Grand Total"&REPT(" ", 25)
Then:
- Align the text to the right.
- Change the font color to white.
- Adjust the number in REPT if necessary to position the Grand Total label above the last column.

Note: If you later add another unique value to the Status column and include it in the VSTACK array, the Pivot Table will expand to the right. If the formula in L3 blocks the expansion, Google Sheets will return a #REF! error. In that case, move the formula to a cell farther to the right.
That’s how to sort Pivot Table columns in a custom order in Google Sheets.
Sample Sheet
Make a copy of the following Google Sheets file to explore the helper column formula and the Pivot Table used in this tutorial.
Frequently Asked Questions
Does Google Sheets have a built-in option to sort Pivot Table columns in a custom order?
No. Google Sheets doesn’t provide a built-in option for this. You’ll need to use a helper column as a workaround.
What about sorting Pivot Table rows in a custom order?
Sorting Pivot Table rows requires a different setup. The helper formula used to define the custom order is similar, but the Pivot Table configuration and the method used to restore the Grand Total label are different.
For the complete steps, see How to Sort Pivot Table Rows in Custom Order in Google Sheets.
Can I create the same result without a Pivot Table?
Yes. You can use the QUERY function instead. See Custom Order for QUERY Pivot Headers in Google Sheets.
For the sample data in this tutorial, you can use the following formula:
=ArrayFormula(
LET(
qry, QUERY(A3:D, "select A, sum(D) where A is not null group by A pivot C", 1),
order, HSTACK("*Project*", "*In Progress*", "On Hold", "Completed"),
CHOOSECOLS(qry, XMATCH(order, chooserows(qry, 1), 2))
)
)
Conclusion
Google Sheets doesn’t include a built-in option to sort Pivot Table columns in a custom order, but a helper column provides a reliable workaround. Once configured, the custom column order updates automatically whenever the Pivot Table refreshes, provided new data is included in the Pivot Table’s source range. This makes the approach ideal for dashboards and recurring reports.





For the Column E, how do we fix that? Task 10 comes right after Task 1
Hi, Chanelle Marcelo,
In cell D3, insert the following formula.
={"Sort";ArrayFormula(ifna(REGEXEXTRACT(A4:A&"","[0-9]+")*1))}Make the following two changes within the pivot table editor panel.
1. Modify the range to A3:D1000.
2. Add the new column under Add Rows.