← All how-to recipes

How to sum values between two dates

✓ Verified in LibreOffice 25.8.7.3

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

The formula

AppFormulaNotes
Excel=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. Every formula here is confirmed by actually executing it.