How to Limit Daily Hours and Group Weekly Data in an Excel PivotTable
Question details
The user needs to summarize worker hours by week and month in a PivotTable while capping the daily hours at 80 and accounting for backup staff.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Tracking and reporting worker shifts and hours over weekly and monthly periods using PivotTables.
- Observed behavior
- The goal is to accurately group dates into weeks and months and calculate remaining or capped hours against an 80-hour daily limit without distorting the source data.
Ensure your source data is organized in a clean tabular format with separate columns for dates, workers, shifts, and hours worked, and check that there are no blank rows or text formatted as dates.
Use Helper Columns and PivotTable Grouping
This is the most straightforward method to enforce a daily limit in the source data and summarize it by week and month.
While PivotTable calculated fields are useful, they calculate at the aggregate level and cannot easily cap individual source rows. Using a helper column directly in your source data ensures the 80-hour limit is strictly enforced before aggregation.
In your source data, add a new column next to your actual hours. Use the formula =MIN([@Hours], 80) to ensure the value never exceeds 80.
Select your entire data range, navigate to the Insert tab on the ribbon, and click PivotTable. Place it on a new worksheet.
Drag the 'Date' field to the Rows area. Right-click any date cell in the PivotTable and select 'Group'. Highlight both 'Months' and 'Days'. For 'Days', set the 'Number of days' to 7.
Drag your new helper column (Capped Hours) into the Values area to view the summarized data by week and month with the 80-hour limit applied.

Enforce Daily Limits Using Power Query
Ideal for large datasets where you want to automate the data transformation and capping process before loading it into a PivotTable.
Easily Manage and Group PivotTables in WPS Spreadsheet
WPS Spreadsheet offers powerful and highly compatible PivotTable features that let you group dates by weeks or months and insert helper formulas seamlessly. You can easily manage large datasets and enforce daily limits using its built-in data analysis tools.
- 1. Prepare your dataset: Open your data file in WPS Spreadsheet and ensure columns like Date, Worker, and Hours are clearly labeled without blank rows.
- 2. Add a Helper Column: Create a new column and enter the formula =MIN(D2, 80) (assuming D is your Hours column) to cap the daily hours at 80, then drag to fill.
- 3. Insert the PivotTable: Select your data range, navigate to the Insert tab, and click 'PivotTable'.
- 4. Group by Week and Month: Drag 'Date' to the Rows area, right-click a date cell, choose 'Group', and select both 'Days' (setting the number of days to 7) and 'Months'.

Frequently Asked Questions
Why can't I group dates by weeks in my PivotTable?
This usually happens if your Date column contains blank cells or text values instead of actual dates. Ensure all cells in the source column are properly formatted as dates before attempting to group them.
Can I use a PivotTable calculated field to limit the maximum hours?
A calculated field evaluates data at the aggregate level rather than row-by-row. While it can calculate the difference (e.g., =80 - Hours) to show remaining capacity, it cannot easily cap individual source rows. Using a helper column in the source data is the recommended approach.
How do I group PivotTable dates by exactly one week?
Right-click any date in your PivotTable and select 'Group'. In the grouping dialog box, deselect 'Months' or 'Quarters', select only 'Days', and set the 'Number of days' counter at the bottom to 7.




