How to Use SUMIFS to Sum Excel Values by Month and Year
Question details
Calculate the total sum of values for a specific month and year dynamically without manually typing start and end dates.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating dynamic monthly reports or dashboards where data needs to be aggregated based on a user-defined target month cell.
- Observed behavior
- The user seeks a dynamic formula method to sum values falling between the first and last days of a specified month and year.
Ensure your date column contains valid Excel date serial numbers, not just text strings. The target month cell used for your criteria should also be formatted as a valid date, typically the first day of the target month.
Use SUMIFS combined with the EOMONTH Function
By pairing SUMIFS with EOMONTH, you can automatically calculate the upper and lower boundaries for any given month to sum data dynamically.
The EOMONTH function calculates the last day of the month for a specified date. Using this alongside the SUMIFS function creates a dynamic boundary from the first day to the final day of your target month, eliminating the need to type exact dates manually.
Select a cell (e.g., D2) and enter your target month and year as a valid date. For example, type '1/1/2023' to represent January 2023.
Click on the cell where you want the total sum for that month to appear.
Type the formula: =SUMIFS(Table1[Units], Table1[Date], ">="&D2, Table1[Date], "<="&EOMONTH(D2,0))
Press Enter. The formula will automatically sum all the values in the 'Units' column that fall between the date in D2 and the last day of that exact month.

Easily Sum Data by Month and Year in WPS Spreadsheet
WPS Spreadsheet fully supports advanced functions like SUMIFS and EOMONTH, allowing you to build dynamic monthly reports effortlessly. Enjoy a familiar interface and comprehensive data analysis tools for free.
- 1. Open your data file: Launch WPS Spreadsheet and open the document containing your date and unit columns.
- 2. Select your output cell: Click the cell where you want to calculate the monthly total.
- 3. Input the dynamic formula: Type =SUMIFS(Units_Range, Date_Range, ">="&Target_Date, Date_Range, "<="&EOMONTH(Target_Date,0)) and press Enter.
- 4. Format your target date: Right-click your target date cell, choose 'Format Cells', and select a custom format (like 'mmm-yyyy') to cleanly display the target month.

Frequently Asked Questions
Why is my SUMIFS formula returning a zero?
This usually happens if your dates are formatted as text instead of valid date values. Select your date column, go to Data > Text to Columns, and click Finish to convert them into proper dates that SUMIFS can recognize.
Can I sum values by year without specifying a month?
Yes. You can use a similar SUMIFS formula but adjust the boundaries using the DATE function. For example, to sum for the year specified in cell D2: =SUMIFS(Units, Dates, ">="&DATE(D2,1,1), Dates, "<="&DATE(D2,12,31)).
Does EOMONTH account for leap years?
Yes, the EOMONTH function automatically adjusts for leap years in Excel, returning February 29th for a leap year and February 28th for a standard year.




