Sum Values by Criteria and Month with SUMPRODUCT in Excel
Question details
Sum values from a weekly date table by month using two matching criteria in Excel.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A source table has two criteria columns and weekly dates across its header row. A results table needs monthly totals for each criteria combination.
- Observed behavior
- The desired result is a monthly total of values whose row criteria match and whose weekly dates fall within the selected month.
Check that the source dates in C4:O4 and the month headings in row 13 are real Excel dates. For the formula below, each month heading must contain the first day of its month.
Use SUMPRODUCT with two criteria and monthly date boundaries
Use this formula to total weekly values that match both row criteria and fall within each month.
The formula compares the criteria in columns A and B, checks whether each weekly date falls between the month heading and the end of that month, and sums the corresponding values. Adjust the ranges if your table has different dimensions.
Place the first and second criteria in A5:A10 and B5:B10, weekly dates in C4:O4, and the corresponding numeric values in C5:O10.
Enter the criteria to match in A14 and B14. Enter the first day of the desired month as a real date in C13, and add other month headings across row 13.
In C14, enter =SUMPRODUCT(($A$5:$A$10=$A14)*($B$5:$B$10=$B14)*(EOMONTH(C$13,0)>=$C$4:$O$4)*(C$13<=$C$4:$O$4)*($C$5:$O$10)).
Select C14 and drag its fill handle down and across to calculate totals for the other criteria pairs and month headings.

Convert source dates stored as text
Use this check if valid-looking weekly dates are not included in the monthly totals.
Sum weekly data by month in WPS Spreadsheets
Use SUMPRODUCT and EOMONTH in WPS Spreadsheets to calculate monthly totals for two matching criteria, then fill the formula across your results table.
- 1. Open the workbook: Open WPS Spreadsheets and use Menu > Open to select your Excel workbook.
- 2. Check the table: Confirm that A5:A10 and B5:B10 contain the source criteria, C4:O4 contains real weekly dates, and C5:O10 contains the values.
- 3. Enter criteria and a month: Enter the criteria in A14 and B14, and enter the first day of the month as a date in C13.
- 4. Calculate and fill: In C14, enter =SUMPRODUCT(($A$5:$A$10=$A14)*($B$5:$B$10=$B14)*(EOMONTH(C$13,0)>=$C$4:$O$4)*(C$13<=$C$4:$O$4)*($C$5:$O$10)). Drag the fill handle down and across to calculate the remaining totals.
- 5. Save the workbook: Use Menu > Save As and select an Excel format such as XLSX if you need to share the workbook with Excel users.

Frequently Asked Questions
Why must the month heading be the first day of the month?
The formula uses C13 as the inclusive start date and EOMONTH(C13,0) as the end date. If C13 is a later day, earlier dates in that month are excluded.
How can I tell whether a weekly date is stored as text?
Enter =ISNUMBER(C4) in an empty cell. If it returns FALSE, check the source value and use Data > Text to Columns to convert recognizable text dates.
Does the formula include the last day of the month?
Yes. The comparison EOMONTH(C13,0)>=$C$4:$O$4 includes dates equal to the last day, provided the source dates do not contain later time values.
Why do the source ranges need matching dimensions?
Each criteria range must cover the same rows as the values, and the date header must cover the same columns. If you expand C5:O10, update the corresponding criteria and date ranges as well.




