FormulaCraft

How to sum values by week in Excel and Google Sheets

Topic:SUM & aggregation
Excel & Google Sheets
=SUMPRODUCT((WEEKNUM(A2:A5,2)=22)*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. 1Put your dates in column A and numeric values in column B.
  2. 2Decide which week number to sum (e.g. week 22). In an empty cell enter =SUMPRODUCT((WEEKNUM(A2:A5,2)=22)*B2:B5).
  3. 3Press Enter. The formula multiplies a TRUE/FALSE array (1 for rows in week 22, 0 otherwise) by the values and sums the products.

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

What if I want to sum by ISO week?

Use ISOWEEKNUM instead of WEEKNUM: =SUMPRODUCT((ISOWEEKNUM(A2:A5)=22)*B2:B5). Both apps support ISOWEEKNUM.

Can I sum by week across multiple years?

Add a YEAR check: =SUMPRODUCT((YEAR(A2:A5)=2024)*(WEEKNUM(A2:A5,2)=22)*B2:B5).

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: