Group Dates in Pivot Tables: Excel Tips
In this article
To group dates in an Excel pivot table, right-click any date cell in the row or column area and choose Group, then select the date range (days, months, quarters, years) you want. This instantly collapses daily dates into the periods you pick, making summaries like monthly sales or quarterly totals much easier to read.
in t | Finish time | min | 50 | 0 in d | Distance | km | 10 | 0 out pace | Average pace | min/km | t / d | 2 out speed | Average speed | km/h | d / (t / 60) | 2
Formula
The grouping itself isn’t a formula—it’s a pivot table feature that buckets dates into periods. However, the underlying calculation for any grouped value (like total sales per month) is simply the sum (or average, count, etc.) of the numeric field for all dates that fall within each period. For example, if you group by month, Excel sums all values where the date’s month equals January, then February, and so on.
Worked Example
Suppose you have a sales table with dates from January 1 to March 31 and a “Sales” column. In the pivot table, you drag “Date” to Rows and “Sales” to Values. Right-click a date (say Jan 15) → Group → select “Months” → OK. The pivot table now shows three rows: Jan, Feb, Mar, each with the total sales for that month. If you also select “Years,” you get Year and Month levels (e.g., 2025 > Jan).
Why Group Dates in a Pivot Table?
Raw dates in a pivot table create one row per day, which is often too granular. Grouping solves several problems:
- Readability: Monthly or quarterly totals are easier to scan than 365 daily rows.
- Trend analysis: Comparing month-over-month or year-over-year becomes straightforward.
- Charting: Grouped dates make line charts cleaner and more meaningful.
- Performance: Fewer rows in the pivot mean faster recalculation and less clutter.
How to Group Dates Step by Step
- Click anywhere inside your pivot table that contains a date field (in Rows or Columns).
- Right-click on any date cell and choose Group (or go to the PivotTable Analyze tab → Group Field).
- In the Grouping dialog, select one or more periods: Seconds, Minutes, Hours, Days, Months, Quarters, Years. You can hold Ctrl to pick multiple (e.g., Months and Years).
- Set the “Starting at” and “Ending at” dates if you want to limit the range (optional).
- Click OK. The pivot table now shows the grouped periods.
Common Problems and Fixes
- “Cannot group that selection” error: This usually means your date column contains text or blank cells, not real dates. Convert text to dates using the DATEVALUE function or Text to Columns, and ensure no blanks.
- Grouping option is greyed out: The field may be in the Filters area, or the pivot is based on a data model (OLAP). For data model pivots, grouping is limited—consider using a regular range instead.
- Dates don’t group by month: If you only see “Days” in the grouping dialog, your data might include times. Clear time by using the INT function on the date column.
- Grouping creates too many levels: Deselect unwanted periods in the dialog (e.g., only check “Months” if you don’t need years).
Grouping by Week or Custom Periods
Excel’s built-in grouping doesn’t have a “week” option directly. To group by week, add a helper column to your source data with a formula like =INT((A2-DATE(YEAR(A2),1,1))/7)+1 to get the week number, then group by that field. Alternatively, use =A2-WEEKDAY(A2,2)+1 to get the Monday date of each week, then group by that date. This gives you weekly totals without manual effort.
Grouping Dates in Excel Online and Mac
Excel for the web (online) supports grouping dates, but with fewer options—typically days, months, quarters, and years. Right-click a date cell and look for “Group” (it may be under “Date Grouping”). On Excel for Mac, the process is similar: right-click a date → Group → select periods. If the option is missing, ensure your data is formatted as dates and that you’re using a pivot table (not a data model).
Frequently Asked Questions
Why can’t I group dates in my pivot table?
Most often it’s because the date column contains text or blanks. Convert text to real dates (using DATEVALUE or Text to Columns) and remove blank cells. Also, if your pivot is from a Data Model (Power Pivot), grouping is not available—rebuild using a regular range.
How do I group by week in a pivot table?
Excel doesn’t have a built-in “week” grouping. Add a helper column to your source data that calculates the week number or the Monday date of each week, then use that field in the pivot and group by day (or just use it as a row label).
Can I group dates by quarter and year at the same time?
Yes. In the Grouping dialog, hold Ctrl and select both “Quarters” and “Years.” This creates a two-level hierarchy: Year, then Quarter. You can also include Months for a three-level breakdown.
Does grouping dates change my original data?
No. Grouping is a display feature in the pivot table; your source data remains untouched. If you refresh the pivot, the grouping stays applied as long as the field is still a date.
How do I ungroup dates in a pivot table?
Right-click any grouped date cell and choose “Ungroup” (or go to PivotTable Analyze → Ungroup). This removes all grouping levels and returns to daily dates.
Why does my pivot show “(blank)” for dates?
This usually indicates blank cells in your date column. Fill those with a date or remove the rows. Also, check for text that looks like dates—convert them to real dates.