Sub topic 10
Grouping dates by month, quarter or year
This chapter assumes you can build a pivot table with rows and values, and that your source column holds real dates, not text that looks like dates. You will turn a column of daily dates into months, quarters or years, choose between grouping styles that look alike but behave differently, and handle cases that Sheets does not cover, such as fiscal years.
Why group dates
A sales table might have one row per order, with a different date on each. If you put that date field in Rows, the pivot table creates one row per distinct day. That is far too detailed for a summary. Grouping collapses the days into larger buckets, so each row shows a month, a quarter or a year.
The grouping happens inside the pivot table. Your source data is not changed, and no helper column is needed for the standard groupings.
Creating a date group
Assume a Sales sheet with a header row and these columns: A is Date, B is Region, E is Revenue. The pivot table has Date in Rows and Revenue summed in Values.
- Right-click any date value in the pivot table's row (or column) header area.
- Choose Create pivot date group.
- Pick a grouping from the list, for example Year-Month.
The rows are replaced by one row per group, and the Values are re-summed per group. To undo it, right-click a group label and choose Remove pivot date group.
Choosing a grouping
The list contains two kinds of grouping. Understanding the difference matters more than any other point in this chapter.
- Continuous groupings include the year, such as Year, Year-Month, Year-Quarter and Year-Month-Day. January 2024 and January 2025 stay separate rows, in chronological order.
- Cyclical groupings leave out the year, such as Month, Quarter, Day of week, Day of month and Day of year. All Januaries merge into one row, whatever the year.
| Grouping | Example row | Years kept apart? | Typical use |
|---|---|---|---|
| Year | 2025 | Yes | Annual totals |
| Year-Quarter | 2025-Q2 | Yes | Quarterly trend over time |
| Year-Month | 2025-Mar | Yes | Monthly trend over time |
| Quarter | Q2 | No | Seasonality across years |
| Month | Mar | No | Seasonality across years |
| Day of week | Monday | No | Which weekdays are busiest |
The exact label wording can differ by locale and by Sheets version. The point is whether the year is part of the group.
Using the year as a column
You can also group the same date field twice. Put Date in Rows grouped by Month, and add Date again in Columns grouped by Year. This produces a compact table with months down the side and one column per year. It is a good layout for comparing the same month in different years.
To add the second copy, click Add next to Columns in the pivot table editor and choose Date again. Then right-click one of its values and create a separate date group. Each copy of the field keeps its own grouping.
Sorting grouped dates
Continuous groupings sort chronologically when you sort ascending by the group. Cyclical groupings such as Month and Day of week sort by their calendar order, not alphabetically, so you get January before February and Monday before Tuesday. If a sort looks wrong, check the Rows entry in the editor: under Order, make sure it sorts by the date field itself and not by a Values column. Sorting by a value is useful when you want the busiest month first, but it breaks the time order.
When the grouping option is missing
If Create pivot date group does not appear, or the date field produces one row per text value, the source column is probably not stored as dates. Check these causes:
- The values are left-aligned, which usually means text. Real dates align to the right by default.
- The column mixes dates and text, for example a note such as "TBD" in one cell.
- Dates were pasted in a format your spreadsheet locale does not read, such as day-first dates in a month-first locale.
You can test a cell with a formula:
=ISDATE(A2)Convert text to dates with DATEVALUE or by re-entering the column using Format > Number > Date. Then refresh the pivot table by re-selecting its data range if needed.
Blank date cells appear in the pivot table as a blank group. If you do not want that group, open the Date field's Filter area in the editor and clear the blank option.
Fiscal years and custom periods
Sheets groups by calendar year only. It has no setting for a fiscal year that starts in July, or for custom periods such as 4-4-5 retail calendars. The reliable fix is a helper column in the source data, which the pivot table then treats as an ordinary field.
For a fiscal year that starts in July and is named by the calendar year in which it ends, put this in a helper column header cell and a formula below it:
=ARRAYFORMULA(IF(A2:A="",, "FY" & YEAR(EDATE(A2:A, 6))))July 2025 returns FY2026, and June 2026 also returns FY2026. For the fiscal quarter within that year:
=ARRAYFORMULA(IF(A2:A="",, "Q" & (INT(MOD(MONTH(A2:A) - 7, 12) / 3) + 1)))July through September give Q1, and April through June give Q4. Put the helper column next to the source data, include it in the pivot table's data range, and use it in Rows like any other field. The cost is that the helper is text, so you lose the built-in chronological behavior. Sort by the fiscal year label, and the labels order correctly because they are fixed-width.
Checking a grouped result
After grouping, confirm one bucket against the raw data. For March 2025 revenue, this formula uses a half-open date range that avoids month-length problems:
=SUMIFS(Sales!E:E, Sales!A:A, ">=" & DATE(2025,3,1), Sales!A:A, "<" & DATE(2025,4,1))The result should equal the 2025-Mar row. To produce the whole table by formula, use QUERY:
=QUERY(Sales!A1:E, "select year(A), month(A), sum(E) where A is not null group by year(A), month(A) label year(A) 'Year', month(A) 'Month (0 = Jan)', sum(E) 'Revenue'", 1)Note that in the query language month() is zero-based, so January is 0. This is a frequent source of off-by-one errors when you compare the output to a pivot table.
Common problems
- Totals look too large. You used a cyclical grouping across several years. Switch to a Year-based grouping.
- Rows show as individual days or timestamps. The field is not grouped yet, or it contains times. Apply a group, or use Year-Month-Day to ignore the time of day.
- A new date does not appear in its group. The new row is outside the source range. Extend the range, or use an open-ended one.
- Group labels cannot be renamed. Date group labels come from the date values. If you need your own labels, use a helper column instead.
- Dates before 1900 or far in the future group oddly. These are usually data entry errors, such as a year typed as 205 instead of 2025. Filter them out and correct the source.
Exercise
Your data covers January 2023 to December 2025. You group the Date field by Month and see 12 rows, with January showing a total about three times larger than you expected for one year. What happened, and how do you fix it so you can compare each month across years?
Show answer
Month is a cyclical grouping that merges the same month from all three years into one row. To fix it, remove the grouping and create a pivot date group with Year-Month, which gives 36 rows in time order. Alternatively, keep Month in Rows and add the Date field to Columns grouped by Year, which shows one column per year.
Exercise
Your company's fiscal year starts on 1 October and is named by the calendar year in which it ends. Write the helper formula for the fiscal year label, assuming dates are in A2:A, and give the label for 15 November 2025.
Show answer
=ARRAYFORMULA(IF(A2:A="",, "FY" & YEAR(EDATE(A2:A, 3)))). Adding 3 months moves 15 November 2025 to 15 February 2026, so the label is FY2026.