Fix SUMIF Date Formula Returning Zero or SPILL Errors in Excel
Question details
The user needs to correct a SUMIF formula that returns 0 or a #SPILL! error when trying to sum values up to a specific date or reporting period.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating total amounts due by a specific date using the SUMIF function and a named range for the date threshold.
- Observed behavior
- The formula evaluates to 0 or triggers a #SPILL! error instead of returning the correct sum.
Ensure that your date column contains valid date values rather than text, and verify that the named range (e.g., Max_Due_Date) evaluates to a single valid date.
Correcting the SUMIF Criteria Syntax Using Concatenation
Fix the SUMIF formula returning 0 by keeping the comparison operator inside quotation marks and concatenating the named date range outside of them.
When a named range is placed entirely inside quotation marks (e.g., "<Max_Due_Date"), Excel treats it as literal text rather than evaluating the date value, causing the formula to return 0. The #SPILL! error typically occurs if the formula is incorrectly structured to return an array of values instead of a single sum, or if arguments are placed in the wrong order.
Locate the column containing dates (e.g., R5C7:R15C7) and the column containing the amounts to sum (e.g., R5C9:R15C9).
Structure the SUMIF formula by separating the comparison operator and the named range. Enter the formula: =SUMIF(R5C7:R15C7, "<="&Max_Due_Date, R5C9:R15C9).
Press Enter. The formula will now correctly evaluate the named range as a date and return the accurate sum without spilling.

Calculate Date-Based Sums Easily in WPS Spreadsheet
WPS Spreadsheet offers powerful formula support, including SUMIF and EOMONTH, with robust error-checking to help you prevent issues like #SPILL! and accurately analyze your financial data.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your financial data.
- 2. Select the target cell: Click on the cell where you want the total sum to appear.
- 3. Enter the SUMIF formula: Input =SUMIF(G5:G15, "<="&Max_Due_Date, I5:I15) and hit Enter to get accurate date-based sums instantly.

Frequently Asked Questions
Why does my SUMIF formula return a #SPILL! error?
A #SPILL! error occurs when a formula returns an array of multiple results that overlap with adjacent cells containing data. In SUMIF, this can happen if the arguments are ordered incorrectly (e.g., using the sum range as the check range), causing the application to evaluate an array instead of outputting a single total.
How do I sum values between two dates in Excel?
To sum values between a start and end date, use the SUMIFS function instead of SUMIF. For example: =SUMIFS(Amount_Range, Date_Range, ">="&Start_Date, Date_Range, "<="&End_Date).
Why is my SUMIF returning 0 when comparing dates?
This usually happens because the comparison operator and the cell reference (or named range) are entirely enclosed in quotes (e.g., "<A1"). The spreadsheet reads this as literal text instead of a variable. You must separate them using an ampersand, like this: "<"&A1.




