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

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

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

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

Last reviewed: