FormulaCraft

How to group data by week using formulas instead of a pivot in Excel and Google Sheets

Topic:Pivot-style summaries (formula approach)
Excel & Google Sheets
=SUMIFS(B2:B7,A2:A7,">="&A2,A2:A7,"<"&(A2+7))

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. 1Place dates in A2:A7 and amounts in B2:B7.
  2. 2In a summary table, compute each week's Monday: in D2 enter the first Monday of your range, e.g., =A2-WEEKDAY(A2,3) (returns the Monday of that date's week using mode 3).
  3. 3In E2 write =SUMIFS(B$2:B$7,A$2:A$7,">="&D2,A$2:A$7,"<"&(D2+7)).
  4. 4D2+7 is the next Monday, making the range a clean Mon-Sun week without overlap.
  5. 5Add a label in F2 using =TEXT(D2,"\"Wk\" W - mmm d") for readable week headers.

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 use date-range SUMIFS instead of WEEKNUM as a criterion?

WEEKNUM alone can't be used as a SUMIFS criteria range because SUMIFS needs a cell range, not an array expression. Either add a WEEKNUM helper column or use the date-boundary approach shown here.

How do I handle weeks that span two months?

The date-range approach handles this naturally — a week from Jan 29 to Feb 4 is captured by the >=/< date boundaries regardless of month.

Does this work with fiscal weeks?

Yes. Set your D2 anchor to the first day of your fiscal year's first week, then add 7 for each subsequent row.

More on Pivot-style summaries (formula approach)

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: