Sub topic 5
Group dates by year, month, quarter or weekday
This chapter covers pivot date groups. They turn a column of individual dates into larger periods, so a pivot table can report by month or quarter without helper columns. It assumes you can build a basic pivot table with rows, columns and values, and that your source data has one header row and one record per row.
What a pivot date group does
A pivot date group is a rule you attach to a date field in a pivot table. The rule says which part of each date to use as the label, such as the month or the weekday. Sheets reads every date in the source column, extracts that part, and combines rows that share the same result. The values you summarize (SUM, COUNT and so on) are then calculated per group.
The source data is never changed. The grouping lives only in the pivot table, so you can add it, change it or remove it without editing a cell in the source range.
This chapter uses the running example table from earlier in the tutorial. It is shown again here so the numbers can be checked.
Date Region Product Units Revenue Cost
2026-01-05 West Widget 10 250 150
2026-01-19 East Widget 4 100 60
2026-02-02 West Gadget 7 420 245
2026-02-23 South Gadget 3 180 105
2026-03-09 East Gizmo 12 600 420Prerequisite: the column must contain real dates
Date groups only work when Sheets treats the cells as dates. A value that merely looks like a date but is stored as text is ignored by the grouping feature. You will not see the grouping option for it, or the values will appear as separate text items.
Check the column before you build the pivot table:
- Real dates are right-aligned by default, and they respond to Format, then Number, then Date.
- Text dates are left-aligned by default. A formula such as
=ISNUMBER(A2)returns FALSE for them. - A column that mixes real dates and text will group only the real dates. Fix the text entries first.
If the column holds text, convert it in a helper column and point the pivot table at the helper column.
=ARRAYFORMULA(IF(A2:A="",,DATEVALUE(A2:A)))Format the result as a date. DATEVALUE depends on your spreadsheet locale. A string like 03/04/2026 may be read as March 4 or April 3 depending on that setting. Check a few converted values by eye.
Blank cells in the date column produce a blank group in the pivot table. Delete rows that have no date, or accept a blank item in the output.
Create a date group
- Select the source range and choose Insert, then Pivot table.
- In the pivot editor, next to Rows, choose Add and pick Date.
- Under Values, add Revenue (summarized by SUM).
- In the pivot table itself, right-click one of the date labels.
- Choose Create pivot date group, then pick a grouping from the list.
The Date row now shows the chosen period instead of the individual dates. With Month selected, the example table collapses to three rows:
| Month | Units | Revenue |
|---|---|---|
| January | 14 | 350 |
| February | 10 | 600 |
| March | 12 | 600 |
| Grand total | 36 | 1550 |
To undo it, right-click a group label and choose Remove pivot date group. The row goes back to showing every individual date.
The available groupings
The list includes parts of a date, such as Day of week, Day of month, Day of year, Month, Quarter and Year. It also includes combined groupings, such as Year-Month, Year-Month-Day and Year-Quarter. If your column holds timestamps, you also get time parts such as Hour and Minute. The exact list depends on whether the field contains only dates or dates with times, so look at what your Sheets version offers.
The difference between a part grouping and a combined grouping is the most important point in this chapter.
- A part grouping looks at one component and ignores the rest. Month means "the month, in any year". January 2026 and January 2027 land in the same row.
- A combined grouping keeps the larger units. Year-Month keeps January 2026 and January 2027 apart.
| Grouping | Label meaning | Merges across years? |
|---|---|---|
| Year | The year only | No, one row per year |
| Quarter | Q1 to Q4 | Yes |
| Year-Quarter | A quarter within a specific year | No |
| Month | Month of year | Yes |
| Year-Month | A month within a specific year | No |
| Day of week | Monday to Sunday | Yes, and across months |
| Day of month | 1 to 31 | Yes |
For any report that spans more than one year, choose Year-Month or Year-Quarter. The plain Month and Quarter groupings are for seasonality questions, such as "which month is strongest across all years".
flowchart TDThe diagram below shows how to choose a grouping.
Worked example: quarter, year and weekday
Apply Quarter to the Date row of the example table. All five dates fall between January and March, so there is a single group, Q1, with 36 units and 1550 revenue. Apply Year and you again get a single row, 2026, with the same totals. Neither result is wrong. The data only covers one quarter of one year, so the grouping has nothing to separate.
Day of week is more instructive. Check the calendar: 5 January, 19 January, 2 February, 23 February and 9 March 2026 are all Mondays. A weekday pivot of this data has one row, Monday, containing everything. This is a quick way to catch a data quality problem. If you expect sales on all days and the pivot shows one weekday, the dates may have been entered as weekly or batch dates, not transaction dates.
Treat a suspiciously uniform group as a finding to investigate before you trust the report.
Combine a date group with columns
Date groups work in the Columns area too. Put Region under Columns, keep Month under Rows, and keep Revenue under Values. Each cell is the revenue for one region in one month, so you get a compact matrix. Moving Month to Columns and Region to Rows gives a layout that fits better when you have many regions but only twelve months.
You can group the same date field only once per pivot table position, but you can add the Date field in two places. For example, put Year under Rows and Quarter under Columns by adding Date twice and giving each its own group. Each added copy has its own grouping choice.
Sorting and filtering grouped dates
Grouped labels sort in calendar order when you sort by the group label, so months appear January to December and not alphabetically. If you instead sort by a value column, such as Revenue descending, the order follows the numbers and the calendar order is lost. Choose the sort that matches the question you are answering.
You can filter on the grouped field. Under the Date field in the editor, use Filters to show or hide specific groups, for example to hide a partial month. A filter on a grouped field acts on the group items, not on the original dates, so you can hide "March" without touching the source.
Fiscal periods need a helper column
Pivot date groups follow the calendar. There is no setting for a fiscal year that starts in July or for a retail 4-4-5 calendar. If you need one, add a helper column in the source data and group by it as ordinary text.
=TEXT(A2,"yyyy")&"-Q"&ROUNDUP(MONTH(A2)/3,0)This gives labels such as 2026-Q1 for calendar quarters. Adjust the month arithmetic for a different fiscal start. For a fiscal year starting in July, a month number shifted by six gives the fiscal quarter. Because the result is text, the pivot table sorts it alphabetically, which still works for the yyyy-Qn pattern.
Check the grouped totals
Always confirm that grouping did not lose rows. Two checks cover most problems:
- The grand total of the grouped pivot table must equal the grand total of the ungrouped one. In the example, both show 1550 for revenue.
- Spot-check one group with a direct formula. This one recomputes February revenue and should return 600.
=SUMIFS(E2:E6, A2:A6, ">="&DATE(2026,2,1), A2:A6, "<"&DATE(2026,3,1))If the grand total is lower than expected, some rows have dates that did not group, usually text dates or blanks. Check the source column.
Common errors
- No grouping option appears. The cell you right-clicked is not a real date, or you right-clicked a value cell. Right-click a row or column label.
- Months from different years are merged. You chose Month. Switch to Year-Month.
- Groups show as separate dates anyway. Some entries are text. Convert them.
- A blank group appears. The source has empty date cells. Remove those rows or filter the blank item out.
- New data does not appear. The pivot source range is fixed. Extend it in the editor, or use a whole-column range such as
A:F. - Wrong weekday names or day boundaries. The spreadsheet time zone affects dates with times. Check File, then Settings, then Time zone.
Exercises
Exercise
The example table is grouped by Day of week with Revenue summed. How many rows does the pivot table show, and what does it tell you about the data?
Show answer
One row, Monday, with revenue 1550. All five dates (5 and 19 January, 2 and 23 February, 9 March 2026) are Mondays, so every record falls in one weekday group. It suggests the dates are batch or weekly dates and not individual transaction dates.
Exercise
A table has sales from January 2026 to December 2027. You group the Date field by Month and see 12 rows. You wanted 24. What do you change, and why did Sheets give 12?
Show answer
Use Year-Month instead of Month. Month is a part grouping that ignores the year, so January 2026 and January 2027 are merged into one January row. Year-Month keeps the year in the label, which gives 24 rows.