How to average values between two dates
✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)The mean of values within a date range — average order value in a period, average daily total for a month.
The formula
| App | Formula | Notes |
|---|---|---|
| Excel (desktop) | =AVERAGEIFS(B2:B100,A2:A100,">="&D1,A2:A100,"<="&D2) | Same pattern as SUMIFS but averages. Returns #DIV/0! if no rows fall in the range. |
| Google Sheets | =AVERAGEIFS(B2:B100,A2:A100,">="&D1,A2:A100,"<="&D2) | Identical. |
| LibreOffice Calc | =AVERAGEIFS(B2:B100,A2:A100,">="&D1,A2:A100,"<="&D2) | Identical. |
How it works
AVERAGEIFS works exactly like SUMIFS with two date bounds, but takes the mean of the qualifying rows instead of the total: the two rows inside the July 24-31, 2026 window are 100 and 40, averaging 70 (the out-of-range row is skipped). Reference the bounds from cells (D1/D2) with the ">="&D1 concatenation to make the period adjustable. One thing to guard: if no rows fall in the range, AVERAGEIFS returns #DIV/0! — wrap in IFERROR(...,0) or IFERROR(...,"-") if an empty period is possible. Add more range/criteria pairs (region, product) to average a slice within the period.
Verified, not just documented
We ran =AVERAGEIFS(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 70 — 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 70 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
AVERAGEIFS — see full Excel, Google Sheets & LibreOffice compatibility for each.