Skip to main content

Conditional formula page

COUNTIFS by Month Formula

Use this when you need a monthly count such as tasks, orders, tickets, or rows.

Best for

Count rows by month with COUNTIFS.

What it returns

If F1 contains a January 2026 date, this counts January 2026 rows.

Copy formulas

Excel formula
=COUNTIFS(A2:A100, ">="&DATE(YEAR(F1),MONTH(F1),1), A2:A100, "<"&EOMONTH(F1,0)+1)
Google Sheets formula
=COUNTIFS(A2:A100, ">="&DATE(YEAR(F1),MONTH(F1),1), A2:A100, "<"&EOMONTH(F1,0)+1)
Excel / Google Sheets difference

Excel and Google Sheets use the same COUNTIFS month-boundary pattern. The formula derives the first day and the first day of the next month from any real date in F1.

Example data

DateRegionProductAmountRep
2026-01-04EastWidget420Maya
2026-01-12WestWidget310Noah
2026-02-03EastGadget275Maya
2026-02-15EastWidget640Iris
What it returns

If F1 contains a January 2026 date, this counts January 2026 rows.

How the formula works

  • The lower boundary is the first day of the selected month.
  • The upper boundary is before the first day of the next month.
  • The count ignores amounts and only counts matching dates.
Syntax pieceRole in the formula
DATE(YEAR(F1),MONTH(F1),1)Builds the first calendar day of F1's month for the inclusive lower boundary.
EOMONTH(F1,0)+1Builds the first day after F1's month as an exclusive upper boundary, including final-day timestamps.
A2:A100The Date range counted; it is not an Amount range.

Verified examples

Count January 2026
=COUNTIFS(A2:A100, ">="&DATE(YEAR(F1),MONTH(F1),1), A2:A100, "<"&EOMONTH(F1,0)+1)

Excel: Enter any January 2026 date in F1; the sample Date range has two January rows. Returns: 2

Count February 2026
=COUNTIFS(A2:A100, ">="&DATE(YEAR(F1),MONTH(F1),1), A2:A100, "<"&EOMONTH(F1,0)+1)

Google Sheets: Enter any February 2026 date in F1; the sample Date range has two February rows. Returns: 2

January rows in East
=COUNTIFS(A2:A100, ">="&DATE(YEAR(F1),MONTH(F1),1), A2:A100, "<"&EOMONTH(F1,0)+1, B2:B100, "East")

Excel: Enter any January 2026 date in F1 and use East as the Region criterion. Returns: 1

Common errors and fixes

IssueLikely causeFix
Changing F1 does not change the monthly countF1 contains a month label or date-looking text rather than a real spreadsheet date.Enter a real date such as 2026-01-15 and format it to display the month if needed.
January records from several years are combinedA MONTH-only test ignores YEAR when comparing dates.Keep both full DATE(YEAR(F1),MONTH(F1),1) and EOMONTH(F1,0)+1 boundaries.
Records late on the final day are missingThe upper boundary is the final date at midnight while source cells contain timestamps, or criteria ranges are misaligned.Use the exclusive next-month boundary and keep every criteria range aligned to rows 2 through 100.

When not to use this formula

  • Do not use this formula when the desired result is an Amount total; use SUMIFS with the same month boundaries instead.

Alternatives

AlternativeWhen to use it
COUNTIFS Between Dates FormulaUse when the start and end dates are selected independently rather than derived from one month cell.
COUNTIFS Formula BuilderUse when the month condition must be combined with configurable criteria.

Related formulas

Official references

FAQ

Can F1 contain any date in the month?

Yes. YEAR and MONTH extract the month and year from any real date in F1; it does not have to be the first day.

Why is the upper test less than the next month?

An exclusive next-month boundary includes every time value on the final day without relying on a midnight end-date comparison.