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

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

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

Related tasks

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

Last reviewed: