COUNTIF Formula Generator (2026) — Count Cells by Criteria | Excel & Sheets
Counts the number of cells within a range that meet the given condition.
Mastering COUNTIF: Count Cells That Meet Any Condition
The COUNTIF function is essential for data analysis, quality control, and reporting. Need to know how many orders exceed $1,000? How many tasks are marked "Complete"? How many entries fall within a date range? COUNTIF answers these instantly.
COUNTIF Syntax & Common Patterns
The basic syntax: =COUNTIF(range, criteria)
- Count exact text:
=COUNTIF(A:A, "Completed") - Count numbers greater than:
=COUNTIF(B:B, ">1000") - Count blank cells:
=COUNTIF(A:A, "") - Count non-blank cells:
=COUNTIF(A:A, "<>") - Count dates after a specific date:
=COUNTIF(A:A, ">="&DATE(2026,1,1))
When COUNTIF Meets Wildcards
Wildcards make COUNTIF extremely powerful for partial matching. Use * for any sequence of characters and ? for a single character. For example, =COUNTIF(A:A, "*East*") counts all cells containing "East" — including "Northeast" and "Eastern".
Pro Tip: For multiple conditions, upgrade to COUNTIFS. The syntax is =COUNTIFS(criteria_range1, criteria1, criteria_range2, criteria2). It's like COUNTIF on steroids.
Common Errors & Fixes
COUNTIF returns 0 or wrong count
Causes:- Criteria not in quotes for text (e.g. "Yes" not Yes).
- Data type mismatch: numbers stored as text or vice versa.
- Extra spaces in cells; criteria does not match exactly.
Fixes:- Wrap text criteria in double quotes: "Completed", ">100".
- Use TRIM on data or match the stored format.
- For numbers, use "=100" or ">50" as the criteria string.
Frequently Asked Questions
Can COUNTIF handle multiple criteria?
Why does COUNTIF return 0 when I expect a count?
How do I count blank or non-blank cells?
What is the difference between COUNTIF and COUNTIFS?
Can COUNTIF use wildcards?
How do I count cells with a date in a range?
Want to become an Excel Pro?
Stop searching for formulas. Master Excel in 30 days with this top-rated course.
Learn More