Free, no sign-up required

COUNTIF / COUNTIFS Formula Generator

Describe what you want to count and under what conditions, in plain English, and get a ready-to-use COUNTIF or COUNTIFS formula for Excel or Google Sheets.

5 free tries without an account

COUNTIF and COUNTIFS syntax

Syntax
=COUNTIF(range, criteria) =COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2, ...])

Use COUNTIF for a single condition, COUNTIFS when two or more conditions all need to be true. Unlike SUMIF/SUMIFS, there's no separate sum_range — you're just counting matching rows. Formulon figures out which one you need and builds the criteria for you.

Examples

Count how many orders are "Shipped"

=COUNTIF(C:C,"Shipped")

Checks every cell in column C and counts how many equal exactly "Shipped".

Count orders shipped to the West region in January

=COUNTIFS(B:B,"West",C:C,"Jan")

Counts rows where column B equals "West" AND column C equals "Jan" — both conditions must be true for a row to be counted.

Frequently asked questions

What's the difference between COUNTIF and COUNTIFS?

COUNTIF counts cells in a range that match a single condition. COUNTIFS counts cells that match two or more conditions at once (an AND) — you list each range/criteria pair as its own pair of arguments.

Can I count with "greater than" or a date range?

Yes — criteria supports comparison operators as text, e.g. =COUNTIF(B:B,">100") or, for a date range with COUNTIFS, two criteria on the same date column like ">="&D1 and "<="&D2.

Does COUNTIF work the same in Google Sheets?

Yes, both COUNTIF and COUNTIFS have identical syntax and behavior in Excel and Google Sheets.

Why is my COUNTIF returning 0 or the wrong count?

The most common causes are extra whitespace in the cells being compared, criteria text not matching exactly (including case of punctuation), or comparing numbers that are actually stored as text.

Don't want to write it by hand?

Describe what you need in plain English and get a ready-to-use formula in seconds.

Try the formula generator