How to Sort Months in Pivot Table Google Sheets
Building a pivot table in Google Sheets is a great way to summarize a lot of data quickly, but you may have encountered an annoying problem: your months are sorted alphabetically instead of chronologically. Seeing "April, August, December" instead of "January, February, March" can make your report confusing and hard to read. This article will walk you through the best methods to fix this, so your reports are always presented correctly.
Why Google Sheets Sorts Months Alphabetically
The root of the problem lies in how Google Sheets understands data types. When you have a column of dates (like 1/15/2024, 2/22/2024, etc.) and you use a formula like =TEXT(A2, "mmmm") to pull out the month name, you're converting a date into a simple text string. To the pivot table, "January" isn't the first month of the year, it's just a word that starts with "J."
When the pivot table is created, its default behavior is to sort text-based rows in alphabetical order (A-Z). This results in the jumbled order that causes so much frustration: August comes before February, and July comes before June. The fix is to give the pivot table a numerical value to sort by, ensuring everything lines up in the right calendar order.
Method 1: Use a Helper Column (Most Reliable Method)
The most robust way to solve this sorting issue is by adding a "helper column" to your original source data. This column will contain a number corresponding to the month (1 for January, 12 for December), giving the pivot table a logical value to sort on. A variation of this makes it even easier by combining the number and the name.
Step 1: Create the Helper Column in Your Source Data
Navigate to your raw data tab - not the pivot table itself. Find the first empty column next to your data and give it a clear header, like "Month Sort" or "Month Number." We'll explore two great formula options to populate this column.
Option A: The Month Number Formula
This is the simplest approach. If your date is in cell A2, you would use the MONTH() function.
=MONTH(A2)This formula will extract the month number (1, 2, 3, etc.) from the date in cell A2. Drag this formula down for all your rows. Your new column will now contain numbers representing each month.
Option B: The Combined Sort and Display Formula
This is my personal favorite because it creates a new column that is both sortable and easy to read, which can sometimes replace the need for a separate month column altogether. Using the TEXT() function with a custom format, you can prefix the month name with its number.
=TEXT(A2, "mm - mmmm")Let's break this formula down:
TEXT(A2, ...)tells Google Sheets to convert the date in A2 to a text string in a specific format."mm - mmmm"is that format.mmgives you the zero-padded month number (01, 02, 03), andmmmmgives you the full month name (January, February, March).
The result in your cell will look like "01 - January," "02 - February," and so on. Because it starts with a number, it will sort perfectly while still being human-readable.
Step 2: Update Your Pivot Table
Now, go back to your pivot table. Since you've added a new column, you need to tell the pivot table to include it.
- Click anywhere inside your pivot table.
- In the Pivot table editor pane on the right, find the "Data range" field.
- Update the range to include your new helper column. For instance, if your data was originally in
A1:C100, and you added the helper column in D, you’d change the range toA1:D100.
Step 3: Add and Sort by the Helper Column
Finally, you'll adjust the pivot table settings to use the helper column for sorting.
If you used Option A (Month Number):
- In the Pivot table editor, under "Rows," click "Add." Select your "Month Name" column (if it's not already there).
- Click "Add" again under "Rows" and select your "Month Sort" column.
- In the "Rows" section, make sure "Sort by" is set to "Month Sort" and the order is "Ascending."
Your pivot table will now show both the month number and the month name, sorted correctly. You probably don't want to see the number, so just uncheck the "Show totals" box next to your "Month Sort" row to hide the numbers, leaving just the perfectly-sorted month names.
If you used Option B (Combined Field):
This is even easier. Remove the old "Month Name" column from your Rows. Add your new combined column (e.g., "01 - January") to the Rows field instead. Set it to sort in ascending order, and you're done. The data is sorted correctly and is perfectly readable.
Method 2: Use Pivot Date Groups (A Quick Alternative)
If you don’t want to add a helper column to your source data, Google Sheets has a built-in feature for grouping dates that works quite well, though it offers a little less customization.
Step 1: Use the Original Date Column
Start by creating a new pivot table (or modifying your existing one). Instead of adding a column with month names to the "Rows" section, add your original date column.
At first, you’ll see every single individual date listed, which isn't very useful.
Step 2: Create a Pivot Date Group
- Right-click on any of the date values within the pivot table itself.
- From the menu that appears, hover over "Create pivot date group."
- You'll see several options like "Year," "Quarter," "Month," etc. Select Month or Year-Month.
Google Sheets will instantly update the pivot table, collapsing all the individual dates into their corresponding months. Because it's still treating them as date objects (not text strings), it knows to sort them chronologically. "Year-Month" is a particularly good option because it correctly handles data that spans multiple years (e.g., Dec 2023, Jan 2024).
Common Issues and Quick Tips
- Is your date even a date? Sometimes, data imported from other systems comes in as text that just looks like a date. You can check this with the
=ISDATE()formula. If it returns FALSE, Google Sheets doesn't recognize it, and you'll need to fix your source data format first. - Refreshing is key. If you update your raw data (like by adding a helper column), always remember to make sure your pivot table's data range is updated to reflect the change.
- Naming is important. Give your helper columns clear, simple headers. This makes them much easier to find and use in the pivot table editor.
Final Thoughts
Dealing with incorrectly sorted months is a classic pivot table headache in Google Sheets, but it's easily solved. Using a helper column with the month number remains the most flexible and reliable method, while the pivot date group feature offers a very fast, formula-free alternative for quick summaries.
Of course, spending time manually creating helper columns and re-configuring pivot tables is often a symptom of a larger issue: a slow, manual reporting process. We built Graphed to eliminate precisely this kind of friction. Instead of wrestling with spreadsheet nuances, you simply connect your data sources (like Google Sheets, Google Analytics, Shopify, etc.) and ask questions in plain English, like, "Show me my sales revenue by month for this year as a bar chart." Graphed instantly builds a live, interactive dashboard that just works, with months sorted correctly from the start. This frees you up to find insights instead of fixing formatting.
Related Articles
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.
How to Create a Photo Album in Meta Business Suite
How to create a photo album in Meta Business Suite — step-by-step guide to organizing Facebook and Instagram photos into albums for your business page.