How to Sum Excel Values Between Dates with Month-End Wraparound
Question details
The user needs to sum values based on a date range that handles the transition (wraparound) from the end of one month to the beginning of the next.

- Product
- Excel / Spreadsheet
- Device & OS
- not provided
- Scenario
- Calculating totals for a rolling day-based cycle or a specific date window that crosses the month boundary.
- Observed behavior
- Standard SUMIFS works seamlessly with actual dates, but summing based purely on day numbers requires special handling for the 31-day cycle transition.
Ensure your date column is formatted as actual dates rather than text, as date-based calculations rely on internal serial numbers to accurately calculate month transitions.
Use SUMIFS with Complete Actual Dates
The safest and most accurate way to calculate sums across month boundaries is to use complete calendar dates (day, month, year) rather than isolated day numbers.
By utilizing full dates, Excel automatically understands month-end transitions, eliminating the need for complex mathematical workarounds to handle 28-day, 30-day, or 31-day months.
Ensure your criteria cell (e.g., H46) contains a full, valid date (such as 10/15/2023) rather than just a day number.
Select the cell where you want the total to appear and enter the SUMIFS formula to define your date window. For example, to sum values in column F based on dates in column E from 1 day before H46 to 5 days after, type: =SUMIFS(F3:F40, E3:E40, ">=" & H46-1, E3:E40, "<=" & H46+5)
Press Enter. The formula will accurately sum the corresponding values, naturally carrying over to the next month if the range extends past the month's final day.

Use a Helper Column for Day-Number Wraparound
If your workflow strictly relies on repeating day numbers (a fixed 31-day cycle) rather than actual dates, use the MOD function to mathematically handle the month-end transition.
Handle Complex Formulas Easily with WPS Spreadsheet
WPS Office provides a powerful, free Spreadsheet tool that fully supports advanced functions like SUMIFS, MOD, and date calculations, ensuring seamless compatibility with Microsoft Excel files.
- 1. Download and Install: Download WPS Office and launch the WPS Spreadsheet application.
- 2. Open Your Workbook: Open your existing Excel workbook containing the date ranges and value columns you wish to sum.
- 3. Apply Your Formulas: Input your SUMIFS or MOD formulas exactly as you would in Microsoft Excel; WPS Spreadsheet calculates them flawlessly.

Frequently Asked Questions
Why doesn't standard SUMIFS work with just day numbers for month-end transitions?
SUMIFS evaluates logical conditions simultaneously. If you tell it to sum values between day 28 and day 3 (of the next month), it interprets the criteria as ">28 AND <3". Because a number cannot be both greater than 28 and less than 3 at the same time, it returns zero. Actual dates or modulo (MOD) formulas are required to handle this logic.
How can I format text dates into actual dates for SUMIFS?
You can convert text dates using the DATEVALUE function. Alternatively, select your date column, navigate to the Data tab, click 'Text to Columns', and click Finish. Finally, apply a 'Short Date' format from the Home tab to ensure they are valid serial numbers.
Does the MOD function work identically in WPS Spreadsheet?
Yes, WPS Spreadsheet offers 100% functional compatibility with Excel's MOD, DAY, and SUMIFS formulas. Any month-end wraparound logic built in Excel will work perfectly in WPS without needing any modifications.




