COUNTIF Generator - Count Cells by Criteria | Excel & Sheets

Counts the number of cells within a range that meet the given condition.

Generated Formula
=COUNTIF(range, criteria)

Learning Resources

Want to master Excel? Check out this Top-Rated Course.

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

Why does COUNTIF return 0 when I expect a count?

Check that your criteria match the data type (number vs text). Use quotes for text: "Completed" or "=100". For numbers use ">50" or "=100". Dates may need DATE() or a cell reference.

How do I count blank or non-blank cells?

Use criteria "" for blanks: =COUNTIF(A:A,""). For non-blanks use "<>": =COUNTIF(A:A,"<>").

What is the difference between COUNTIF and COUNTIFS?

COUNTIF has one condition; COUNTIFS supports multiple criteria ranges. Use COUNTIFS when you need to count only when two or more conditions are met.

Can COUNTIF use wildcards?

Yes. Use * for any characters and ? for one character. Example: =COUNTIF(A:A,"*apple*") counts cells containing "apple".

How do I count cells with a date in a range?

Use criteria with a date: =COUNTIF(A:A,">="&DATE(2025,1,1)) or =COUNTIF(A:A,">"&B1) where B1 holds the date.

Want to become an Excel Pro?

Stop searching for formulas. Master Excel in 30 days with this top-rated course.

Learn More