FormulaCraft

How to sum values by year in Excel and Google Sheets

Topic:SUM & aggregation
Excel & Google Sheets
=SUMPRODUCT((YEAR(A2:A5)=2024)*B2:B5)

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Ensure column A holds dates and column B holds the numeric values to sum.
  2. 2In an empty cell type =SUMPRODUCT((YEAR(A2:A5)=2024)*B2:B5), replacing 2024 with the target year.
  3. 3Press Enter. Rows where YEAR(A) equals 2024 contribute their B value; other rows contribute 0.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

Why does SUMPRODUCT give me 0 when my dates look right?

Dates stored as text won't be recognised by YEAR(). Convert them to real dates using DATEVALUE() or by reformatting the column.

Can I sum by fiscal year instead of calendar year?

Yes — define your fiscal year start month and adjust: e.g. for a July fiscal year use =SUMPRODUCT((YEAR(A2:A5+(31*5))=2024)*B2:B5) to shift months.

More on SUM & aggregation

See all →

Formulas used

Related tasks

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: