Best on desktop
The spreadsheet workspace needs more room than this screen offers. Switch to a laptop for the full experience.
You're a finance analyst building a "rolling 30-day revenue" trend column. For every transaction in the log at A2:B13, compute the sum of revenue from all transactions in the trailing 30 days, including the current row's revenue.
Worked example: a transaction on 2026-02-05 with the trailing window (2026-01-06, 2026-02-05] should sum the revenue of every transaction whose date is strictly greater than 2026-01-06 and less than or equal to 2026-02-05.
The pattern is SUMPRODUCT with two date-bound boolean arrays multiplied against the revenue range, with explicit DATEVALUE coercion on both the range and the current-row date because the spreadsheet engine here treats CSV-loaded date cells as text:
=SUMPRODUCT((DATEVALUE($A$2:$A$13) > DATEVALUE(A2) - 30) * (DATEVALUE($A$2:$A$13) <= DATEVALUE(A2)) * $B$2:$B$13)
The first boolean > DATEVALUE(A2) - 30 excludes transactions older than 30 days (strict >); the second <= DATEVALUE(A2) is the inclusive upper bound (the current row counts in its own window). Multiplying the two booleans gives an array that's 1 only for in-window rows, then multiplying by the revenue range and SUMPRODUCT-summing yields the trailing-30-day total. The window slides as the formula drag-fills down.
(Why not the more obvious SUMIFS? Because SUMIFS' >/<= criteria comparators won't cross-type-coerce string-typed range cells against numeric criteria — the sum would silently come back 0. The DATEVALUE coercion in SUMPRODUCT bypasses this entirely. In real Excel where dates are usually stored as serials, SUMIFS works directly; the SUMPRODUCT pattern is the safer cross-environment choice.)
Your task:
Graded cells: C3 (2026-01-12 → window includes Jan 5 + Jan 12 → 2000), C7 (2026-02-15 → window includes Jan 20, Jan 28, Feb 5, Feb 15 → 6400), C12 (2026-03-25 → window sums to 7500).