Sub topic 7
Grouping by Days and Building Weekly Periods
This chapter assumes you can build a PivotTable, place fields in Rows and Values, and use Sum and Count. It also assumes your date column holds real dates, not text. Chapter "Why dates and numbers can be grouped" explains why that matters.
What you will do
You will group a date field by days to make seven-day weekly periods. You will also build a weekly column in the source data for cases where the dialog does not give the result you want.
Why there is no "Weeks" unit
The Grouping dialog lists Seconds, Minutes, Hours, Days, Months, Quarters, and Years. It has no Weeks option. Excel gets weekly periods from the Days unit instead. When Days is the only unit selected, a Number of days box becomes available. Setting it to 7 makes each group span seven days.
Excel starts counting from the date in Starting at. By default that is the earliest date in the data. If the earliest order falls on a Wednesday, every week runs Wednesday to Tuesday. To get Monday-based weeks, set Starting at to a Monday.
Group by seven days
Suppose column A holds order dates and column B holds amounts. The PivotTable has Order Date in Rows and Sum of Amount in Values.
- Right-click any date in the Row Labels and choose Group.
- In Starting at, enter a Monday on or before your first order. For example, enter 2026-01-05, which is a Monday.
- In By, select Days and clear every other unit.
- Set Number of days to 7.
- Click OK.
Each row now shows a range such as 1/5/2026 - 1/11/2026, with the total for that week.
Limits of day-based weekly groups
Day grouping is quick, but it has costs.
- The group labels show a date range, not a week number.
- The weeks depend on the Starting at value. If someone changes it, every week boundary moves.
- You cannot filter or slice a field that is grouped this way as flexibly as a normal column. You also cannot combine weeks with months in one grouping.
- The groups apply to one PivotTable field. Another PivotTable built from the same cache shares the grouping, which can surprise you.
When you need stable weeks, put the week in the source data instead.
Build a weekly helper column
Add a column next to your data and fill it with a formula that returns the Monday of each order's week. For a date in A2:
=A2-WEEKDAY(A2,2)+1WEEKDAY(A2,2) returns 1 for Monday through 7 for Sunday. Subtracting it and adding 1 moves the date back to that week's Monday. Format the column as a date, refresh the PivotTable, and drag the new Week Starting field into Rows.
You can now use this field like any other. It supports filters, slicers, and sorting, and it does not need the Grouping dialog. Check that the column holds real dates by testing a cell:
=ISNUMBER(A2)If this returns FALSE, the cell holds text and the formula above will give an error.
| Approach | Setup effort | Week start fixed? | Works with slicers |
|---|---|---|---|
| Group by 7 days | One dialog | Depends on Starting at | Limited |
| Helper column | One formula column | Always Monday | Yes |
Worked check
Take an order on Thursday, 2026-01-08. WEEKDAY(date,2) returns 4. The formula gives 2026-01-08 minus 4 plus 1, which is 2026-01-05. That date is the Monday of that week. An order on Sunday 2026-01-11 returns 7, so the result is 11 minus 7 plus 1, giving 2026-01-05 again. Both orders land in the same week.
Common errors
- Grouping fails with "Cannot group that selection." Some dates are blank or stored as text. Fix the source cells first.
- Weeks start on the wrong day. Starting at was left at the earliest date. Set it to a Monday.
- Group boundaries shift after a refresh. If Starting at is set to Automatic, Excel may recompute it when new data arrives. Enter a fixed date instead.
Exercise
An analyst groups an Order Date field with Days selected and Number of days set to 7, but leaves Starting at as the earliest date, which is a Wednesday. She wants weeks that start on Monday. What should she change, and what formula would she use if she moved the logic into the source data instead?
Show answer
She should set Starting at to a Monday on or before the earliest date, then group again. In the source data she can add a helper column with =A2-WEEKDAY(A2,2)+1, which returns the Monday of each date's week, and use that field in Rows.