← All how-to recipes

How to sum values between two dates

✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)

Total amounts that fall in a date range you specify — sales in a period, expenses between two dates.

The formula

AppFormulaNotes
Excel (desktop)=SUMIFS(B2:B100,A2:A100,">="&D1,A2:A100,"<="&D2)A = dates, B = amounts, D1/D2 = start/end dates in cells. Concatenate the operator with the date cell.
Google Sheets=SUMIFS(B2:B100,A2:A100,">="&D1,A2:A100,"<="&D2)Identical.
LibreOffice Calc=SUMIFS(B2:B100,A2:A100,">="&D1,A2:A100,"<="&D2)Identical.

How it works

Two date conditions on the same column bracket the window: on-or-after the start AND on-or-before the end. In the verification the window is July 24-31, 2026, so the two rows in that range total 100+50 = 150 while the August-ish row (serial 46250) is excluded. Putting the start and end dates in cells (D1, D2) and concatenating them with & (">="&D1) makes the range adjustable without editing the formula — the basis of a date-filtered dashboard. The date column must hold real dates, not text. Use "<"&(D2+1) if D2 might carry a time component.

Verified, not just documented

We ran =SUMIFS(B2:B4,A2:A4,">="&DATE(2026,7,24),A2:A4,"<="&DATE(2026,7,31)) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 150 — exactly the expected result. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned 150 for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.

Functions used

SUMIFS — see full Excel, Google Sheets & LibreOffice compatibility for each.

Related recipes

Related comparisons