← All how-to recipes

How to count dates within a range

✓ Verified in LibreOffice 25.8.7.3

Count how many entries fall between two dates — orders this month, signups this quarter.

The formula

AppFormulaNotes
Excel=COUNTIFS(A2:A100,">="&DATE(2026,7,1),A2:A100,"<"&DATE(2026,8,1))The < on the first of the NEXT month cleanly captures all of July, time-of-day included.
Google Sheets=COUNTIFS(A2:A100,">="&DATE(2026,7,1),A2:A100,"<"&DATE(2026,8,1))Identical.
LibreOffice Calc=COUNTIFS(A2:A100,">="&DATE(2026,7,1),A2:A100,"<"&DATE(2026,8,1))Identical.

How it works

Two conditions on the same column bracket the period: on-or-after July 1 AND before August 1. In the sample (dates as their underlying serial numbers), two of the four fall inside July 2026. Using "< first of next month" instead of "<= July 31" is the safe habit — it still works when cells carry a time component like July 31, 14:30. Reference cells for the bounds by concatenating: ">="&E1.

Verified, not just documented

We ran =COUNTIFS(A2:A5,">="&DATE(2026,7,1),A2:A5,"<"&DATE(2026,8,1)) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 2 — exactly the expected result. Every formula here is confirmed by actually executing it.