Pivot Table Weekly Filter: How to Group and Filter Dates
In this article
To add a weekly filter to a pivot table, you must first group your date field by days and set the number of days to 7. Because Excel and Google Sheets do not have a native "Week" grouping option in the standard menu, you create this by grouping by days and specifying the interval. This allows you to aggregate daily data into weekly buckets, which can then be moved into the Filter area of the pivot table to isolate specific weeks of data.
What You'll Need
- A dataset containing a column of dates formatted as actual Date objects (not text).
- A created Pivot Table based on that dataset.
- The date field placed in either the Rows or Columns area of the Pivot Table (this is required to access the grouping menu).
Step-by-Step
- Prepare Your Date Column: Before starting the pivot table, ensure your source data date column is consistently formatted. Select the column, go to the Home tab, and ensure the number format is set to "Short Date". If there are blank cells or text strings like "N/A" in the date column, the grouping feature will be disabled.
- Insert the Pivot Table: Select your data range, go to the Insert tab, and click PivotTable. Choose whether to place it in a new worksheet or an existing one and click OK.
- Add Date to Rows: In the PivotTable Fields pane, drag your date field into the Rows area. At this stage, Excel may automatically group your dates into Months or Years. If it does, right-click any date in the pivot table and select "Ungroup" to return to the individual daily dates.
- Access the Grouping Menu: Right-click on any single date value within the pivot table body. From the context menu, select Group. A small dialog box will appear.
- Configure Weekly Grouping: In the Grouping dialog box, you will see a list of options (Seconds, Minutes, Hours, Days, Months, Quarters, Years). Deselect everything except "Days". Once only "Days" is selected, a "Number of days" box will appear at the bottom. Change this value from 1 to 7.
- Set the Start Date: In the same dialog box, check the "Starting at" date. Excel usually defaults to the first date in your dataset. If that date is a Wednesday, your "weeks" will run Wednesday to Tuesday. To align your weeks with a standard calendar (e.g., starting on a Sunday or Monday), manually change the "Starting at" date to the nearest preceding Sunday or Monday. Click OK.
- Move the Grouped Field to Filters: Your pivot table now displays dates grouped by 7-day increments. In the PivotTable Fields pane, you will see a new field (often named "Date" or "Date2"). Drag this field from the Rows area up into the Filters area.
- Apply the Weekly Filter: Click the drop-down arrow that now appears in the Filter cell at the top of your pivot table. You can now select a single week or check "Select Multiple Items" to choose a specific range of weeks to analyze.
Common Mistakes
The most frequent error is attempting to group dates that contain non-date values. If your source data has a single cell with a typo (e.g., "12/31/2023" written as "12.31.2023" or a blank cell), Excel will gray out the Grouping option entirely. You must clean the source data, remove blanks, or fill them with a placeholder date before the group function becomes available.
Another common mistake is forgetting to adjust the "Starting at" date. If you simply set the interval to 7 days, Excel starts counting from the very first date found in your list. If your data starts on a Thursday, every "week" in your filter will be a Thursday-to-Wednesday block, which can be confusing for stakeholders who expect a standard Monday-Sunday reporting cycle.
Users also frequently confuse the "Slicer" tool with the "Filter" area. While a Slicer is more visual, it cannot create the weekly grouping on its own; the grouping must happen in the Rows/Columns area first before the Slicer can be applied to that grouped field.
Tips
For those who need a more permanent solution that doesn't require manual grouping, consider adding a "Helper Column" to your source data. Use the formula =WEEKNUM(A2) (where A2 is the date). This creates a numerical value representing the week of the year. You can then drag this "Week Number" field directly into your pivot table filters without using the Grouping menu.
If you are using a Timeline Slicer (Insert > Timeline), remember that Timelines only support Years, Quarters, Months, and Days. They do not natively support a "Weekly" view. To get a weekly feel with a Timeline, you must stick to the Day view and manually drag the selection bar across 7-day increments, which is why the Grouping method described above is superior for weekly reporting.
To make your report more readable, rename the grouped field. Instead of leaving it as "Date2", click the cell in the pivot table and type "Reporting Week". This ensures that anyone else viewing the file understands exactly what the filter represents.
Troubleshooting
The "Group" option is grayed out: This happens when the data is not recognized as a date. First, check for empty cells in the date column. Second, try selecting the date column in your source data and using the "Text to Columns" tool (Data tab > Text to Columns > Finish) to force Excel to re-evaluate the data types. Refresh the pivot table and try grouping again.
The dates grouped incorrectly: If your weeks are shifting or don't align with the calendar, you likely have a "Starting at" date issue. Right-click the grouped date, select Group again, and manually enter the date of the Sunday or Monday you wish to be the start of Week 1.
The filter shows individual dates instead of weeks: This occurs if you moved the field to the Filter area before grouping. You cannot group a field while it is in the Filter area. You must move it back to the Rows area, perform the grouping steps, and then move it back to the Filter area.
Changes in source data aren't appearing in the filter: Pivot tables do not update automatically. If you add new dates to your source data, you must go to the PivotTable Analyze tab and click "Refresh". If the new dates fall outside the original grouping range, you may need to right-click and select "Group" again to ensure the new dates are captured in the 7-day logic.
Frequently Asked Questions
Can I group by week in Google Sheets pivot tables?
Google Sheets does not have a "Number of Days" grouping option like Excel. To achieve a weekly filter in Google Sheets, you must create a helper column in your source data using the =WEEKNUM() formula or a custom =FLOOR() formula to find the start of the week, then use that new column as your pivot table filter.
Does grouping by 7 days change my original data?
No. Grouping in a pivot table only changes how the data is summarized and displayed in the report. Your original source data table remains untouched and continues to show the individual daily dates.
Can I filter by both month and week simultaneously?
Yes. When you group by days (7), you can also select "Months" in the grouping dialog box. This will create two separate fields in your field list: one for the Month and one for the Week. You can drag both into the Filter area to create a hierarchical filter.
Why does my week start on a random day?
Excel defaults the start date to the earliest date found in your dataset. If your first transaction was on a Tuesday, your weeks will be Tuesday-to-Monday. You must manually change the "Starting at" date in the Grouping menu to a Sunday or Monday to fix this.
Is there a way to automate this for new data?
The best way to automate weekly filtering is to use a Table (Ctrl+T) for your source data and a helper column with the =WEEKNUM() formula. As you add new rows to the table, the formula calculates the week automatically, and you only need to click "Refresh" on the pivot table.