Excel function

COUNTIF in Excel: count cells that meet one condition

COUNTIF counts how many cells match one condition. It is a beginner-friendly function for answering questions like how many orders are open, how many students passed, or how many rows belong to one category.

What COUNTIF does

COUNTIF counts cells in a range that meet one condition. The syntax is `=COUNTIF(range, criteria)`. The range is where Excel looks. The criteria is the rule each cell must satisfy to be counted.

For example, `=COUNTIF(B2:B20,"Complete")` counts how many cells in B2:B20 contain the text Complete. If C2:C20 contains scores, `=COUNTIF(C2:C20,">=70")` counts scores of 70 or higher.

COUNTIF is useful because it turns a list into a quick answer without manually filtering. It works well for one-condition questions, such as a single status, category, score threshold, or text label.

Arguments explained

`range` is the cells you want to test, such as B2:B50. `criteria` is the condition. Text criteria usually go in quotation marks, like `"Paid"` or `"North"`. Numeric criteria can be written directly when they are simple equality checks, such as `100`, or with comparison operators in quotation marks, such as `">100"`.

Criteria can also reference a cell. If E2 contains the status to count, `=COUNTIF(B2:B50,E2)` counts rows matching that status. For comparison criteria built from a cell, join the operator and reference: `=COUNTIF(C2:C50,">="&E2)`.

COUNTIF has a one-condition limitation. If you need to count rows where status is Complete and region is North, use COUNTIFS instead.

A good habit is to write the question in words before writing the formula. "How many rows have status Open?" maps cleanly to one COUNTIF. "How many North rows are Open?" already has two conditions, so it should move to COUNTIFS.

Practical examples

A beginner school example is counting passing scores. If scores are in C2:C30, `=COUNTIF(C2:C30,">=70")` counts how many students scored at least 70.

A business example is counting open support tickets. If B2:B200 contains ticket status, `=COUNTIF(B2:B200,"Open")` returns the number of open tickets. This is useful for a small dashboard cell that updates as new rows are added.

COUNTIF also works with simple text patterns. `=COUNTIF(A2:A100,"West")` counts exact West labels. Wildcards such as `"West*"` can count text that starts with West, but beginners should first master exact criteria.

When to use it

Use COUNTIF for one-condition counting: one status, one category, one threshold, or one text label. It is often the first function to learn after SUM, because it teaches criteria logic clearly.

Do not use COUNTIF when the question has multiple conditions. Do not use it to add values; use SUMIF or SUMIFS for totals. Do not count messy labels before checking for inconsistent spacing, capitalization, or spelling.

Practical examples

Count completed tasks

=COUNTIF(B2:B20,"Complete")

Counts cells in B2:B20 that exactly contain Complete.

Count passing scores

=COUNTIF(C2:C30,">=70")

Counts scores in C2:C30 that are greater than or equal to 70.

Recommended Excel functions

COUNTIFCOUNTIFSSUMIFIFCOUNTA

Common mistakes

  • 01Using COUNTIF for multiple conditions instead of COUNTIFS.
  • 02Forgetting quotation marks around text criteria or comparison criteria.
  • 03Counting messy labels that contain extra spaces or inconsistent spelling.
  • 04Trying to sum matching values with COUNTIF instead of SUMIF.

Practice

Practice this skill with interactive exercises on Calcu.

Use Calcu to practice COUNTIF in realistic spreadsheet exercises with instant feedback.

FAQ

What is COUNTIF used for?

COUNTIF counts cells that meet one condition, such as a status, category, text label, or score threshold.

Can COUNTIF use comparison operators?

Yes. Use criteria such as ">70", "<=100", or ">="&E2.

What is the difference between COUNTIF and COUNTIFS?

COUNTIF handles one condition. COUNTIFS handles multiple conditions across one or more ranges.