Use SUMPRODUCT in Excel to Sum Values by Year
Question details
Sum values for records that match a specific year when SUMIF cannot use a YEAR-generated criteria range.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains dates and corresponding values, and the user wants to total values for a target year.
- Observed behavior
- SUMIF may return an error when the YEAR function is used to generate its criteria range.
Check that the date cells contain valid Excel dates and that the date and value ranges cover the same rows. Enter the target year as a number in a separate cell.
Sum Matching Values with SUMPRODUCT and YEAR
Use this formula to compare each date's year with a target year and sum the corresponding values.
Place dates in C3:C8, corresponding numeric values in B3:B8, and the target year, such as 2024, in E3.
Select an empty cell and enter =SUMPRODUCT((YEAR($C$3:$C$8)=E3)*$B$3:$B$8), then press Enter.
In the formula bar, replace the example ranges and E3 with your own references, keeping the date and value ranges the same size.

Sum Values by Year in WPS Spreadsheets
Use SUMPRODUCT with YEAR in WPS Spreadsheets to total values that match a year entered in your worksheet.
- 1. Open your spreadsheet: Open WPS Spreadsheets and select Open to load your workbook.
- 2. Check the data: Put valid dates in C3:C8 and their corresponding numeric values in B3:B8, or identify equivalent ranges in your worksheet.
- 3. Enter the target year: Type the year you want to match, such as 2024, in cell E3.
- 4. Calculate the total: Select an empty cell, enter =SUMPRODUCT((YEAR($C$3:$C$8)=E3)*$B$3:$B$8), and press Enter. Adjust the references if your data is elsewhere.

Frequently Asked Questions
Why can't I use YEAR directly as the SUMIF criteria range?
SUMIF expects a range of cells as its range argument, while YEAR applied to a range produces calculated results. SUMPRODUCT can compare those results with the target year and sum the matching values.
What does the multiplication in the SUMPRODUCT formula do?
In =SUMPRODUCT((YEAR($C$3:$C$8)=E3)*$B$3:$B$8), the year comparison produces TRUE or FALSE for each row. Multiplication converts those results to 1 or 0, so only matching values contribute to the total.
Why does the formula return an error instead of a total?
Check C3:C8 for text or errors that YEAR cannot interpret as dates. Also check that the date and value ranges have the same number of rows and that the values being multiplied are numeric.
How do I sum a different year?
Enter the new year as a number in E3. The SUMPRODUCT formula will recalculate using that year without changing the formula itself.




