Calculate Overlapping Absence Days in an Excel 365 Rolling 12-Month Period
Question details
Calculate only the days of each absence that fall within a rolling 12-month reporting period.

- Product
- Microsoft Excel 365
- Device & OS
- not provided
- Scenario
- Absence start and end dates may fall partly outside the reporting window.
- Observed behavior
- A formula may count the entire absence instead of only the days that overlap the reporting window.
Enter absence start dates in column A and end dates in column B as actual Excel dates, without time values. Decide whether absence boundary dates count and choose the reporting period's end date.
Calculate inclusive absence days within the reporting window
Use this method when both the absence dates and reporting-window dates are included in the count.
Enter the reporting end date in E3. In E2, enter =EDATE(E3,-12)+1 to set the start of a 12-month window ending on E3.
In C2, enter =IF(AND(ISNUMBER(A2),ISNUMBER(B2),ISNUMBER($E$2),ISNUMBER($E$3),A2<=B2,$E$2<=$E$3),MAX(0,MIN(B2,$E$3)-MAX(A2,$E$2)+1),""). The formula returns zero when a valid absence does not overlap the window and leaves invalid or missing dates blank.
Drag the fill handle from C2 down through the absence rows. In a separate cell, enter =SUM(C2:C100), adjusting the range to cover your records.

Exclude both absence boundary dates from the overlap
Use this variation when the business rule excludes the absence start and end dates but includes the reporting-window boundaries.
Calculate Rolling Absence Days in WPS Spreadsheet
Use date and overlap formulas in WPS Spreadsheet to count only absence days within your reporting window.
- 1. Open the workbook: Open WPS Spreadsheet and select Open to load your Excel workbook.
- 2. Define the window: Enter the reporting end date in E3 and =EDATE(E3,-12)+1 in E2.
- 3. Calculate the overlap: With absence dates in A2 and B2, enter =IF(AND(ISNUMBER(A2),ISNUMBER(B2),ISNUMBER($E$2),ISNUMBER($E$3),A2<=B2,$E$2<=$E$3),MAX(0,MIN(B2,$E$3)-MAX(A2,$E$2)+1),"") in C2.
- 4. Fill and total: Drag C2's fill handle down the absence rows, then enter =SUM(C2:C100) in a separate cell, adjusting the range as needed.

Frequently Asked Questions
Why does the overlap formula add one day?
The +1 counts both endpoints when the absence and reporting-window dates are inclusive. For example, an absence from March 1 through March 3 counts as three days.
What happens if an absence is entirely outside the reporting window?
MAX(0,...) returns zero for a valid absence with no overlap, preventing a negative day count.
How do I change the rolling period's end date?
Enter a new reporting end date in E3. The EDATE formula in E2 and the overlap formulas will update using that date.
Will the total count the same date twice if absence records overlap?
Yes. SUM adds each row's overlap separately, so overlapping records can double-count shared dates. Combine overlapping intervals first if you need unique absence days.




