Formula Errors

How to Fix SUMIFS and EDATE Month-End Date Problems in Excel

Phi Hung VoPhi Hung Vo Nov 11, 2026 868 views

Question details

The user needs a SUMIF or SUMIFS formula that accurately captures month-end dates when using EDATE, which normally preserves the exact day number and inadvertently skips 31st-day dates.

How to Fix SUMIFS and EDATE Month-End Date Problems in Excel
Product
Excel
Device & OS
not provided
Scenario
Calculating monthly costs or totals using conditional sum formulas where reference dates fall on the exact end of a month.
Observed behavior
A SUMIF formula using EDATE to calculate one month prior to September 30 returns August 30 instead of August 31, causing the formula to exclude costs recorded on August 31.
Before you start

Verify your date formatting in the referenced cells to ensure they are recognized as actual serial dates and not text strings. Additionally, confirm your business logic regarding whether costs on the 30th should also be included alongside the 31st.

Solution 1Recommended

Use a Month-End-Aware Formula Combining EOMONTH and EDATE

Wrap your criteria date calculation in an IF statement that checks if the reference date is the end of the month, using EOMONTH to capture the correct last day instead of EDATE.

The standard EDATE function preserves the exact day number of the starting date. When counting backward from a 30-day month like September 30, EDATE returns August 30. By integrating the EOMONTH function conditionally, you force Excel to recognize the true end of the prior month.

1
Identify your reference date cell

Locate the cell containing your current month's date (for example, cell BF2 containing September 30).

2
Build the conditional month-end logic

Replace the standard EDATE(BF$2,-1) criteria in your formula with an IF condition: IF(BF$2=EOMONTH(BF$2,0),EOMONTH(BF$2,-1),EDATE(BF$2,-1)). This checks if BF2 is the last day of its month, and if so, returns the last day of the previous month.

3
Integrate into the SUMIF formula

Place the logic inside your SUMIF formula. It should look like this: =SUMIF(AA$2:BE$2, IF(BF$2=EOMONTH(BF$2,0),EOMONTH(BF$2,-1),EDATE(BF$2,-1)), AA12:BE12).

4
Apply and verify

Press Enter to apply the formula and check your totals. The costs recorded on August 31 should now be successfully included in the sum.

Use a Month-End-Aware Formula Combining EOMONTH and EDATE
Business Logic Consideration: Review your dataset to decide whether costs falling on the 30th should also be included when rolling back to a 31-day month from a 30-day month. You may need to use greater-than/less-than operators in a SUMIFS if a date range is strictly required.
Advanced Spreadsheet Tool

Calculate Month-End Totals Seamlessly in WPS Spreadsheet

WPS Office provides a highly compatible and lightweight Spreadsheet application that handles complex date functions like EDATE, EOMONTH, and SUMIFS identically to Excel. You can quickly fix date calculation errors without changing your formula habits while enjoying a faster, smoother experience.

  1. 1. Open your spreadsheet in WPS Office: Launch WPS Spreadsheet and open the workbook containing your faulty SUMIF/SUMIFS formula.
  2. 2. Select the formula cell: Click on the cell that currently fails to calculate the correct month-end total.
  3. 3. Update the date calculation criteria: Modify the criteria argument within your formula to use the correct conditional logic: IF(BF$2=EOMONTH(BF$2,0),EOMONTH(BF$2,-1),EDATE(BF$2,-1)).
  4. 4. Calculate the correct total: Press Enter. WPS Spreadsheet will instantly process the correct end-of-month dates and output the accurate financial sum.
Fully compatible with Microsoft Excel date formulas (SUMIFS, EDATE, EOMONTH)Lightweight and fast calculation engine for handling large financial datasetsFree, user-friendly, and features a familiar tabbed interfaceBuilt-in error checking to help troubleshoot and correct complex formula logic
microsoft office alternative - wps office

Frequently Asked Questions

Why does EDATE skip August 31 when calculating one month prior to September 30?

The EDATE function is designed to return the exact same day of the month for the target month. Since September only has 30 days, going back exactly one month from September 30 inherently results in August 30, completely missing the 31st of August.

What is the difference between EDATE and EOMONTH?

EDATE shifts a date by a specified number of months while strictly maintaining the day number (e.g., shifting Jan 15 forward by one month results in Feb 15). EOMONTH shifts the date and always forces the result to the very last day of that target month (e.g., shifting Jan 15 forward by one month results in Feb 28 or 29).

Can I use SUMIFS instead of SUMIF for multiple criteria involving month-end dates?

Yes, SUMIFS works identically to SUMIF but allows for multiple conditions. Just replace the relevant date criteria argument in your SUMIFS function with the exact same IF and EOMONTH logic to ensure the month-end date is calculated accurately across all your conditions.