COUNTIF Function
COUNTIF Function

COUNTIF Function

Count how many cells match one condition. Useful for quick filtered counts like Yes/No, scores above a target, or text matches.

ExcelClash Team
PUBLISHED

Summary

COUNTIF counts how many cells meet one condition. That condition can be a word, a number, a comparison like ">80", a wildcard match, or a cell reference.

This makes it a strong everyday function because you can turn a messy list into one clear tally. Instead of counting by hand, you give Excel one rule and let it do the matching for you.

COUNTIF is one of the most practical statistical helpers because it answers "how many match this rule?" in one step. That makes it useful for status counts, duplicate checks, threshold tracking, and many dashboard-style summaries.

Purpose

Count with one condition

Returns how many cells match a single rule.

Return Value

Number

Returns the number of cells that meet the condition. If nothing matches, the result is 0.

Syntax

=COUNTIF(range, criteria)

range is where Excel looks, and criteria is what Excel tries to match.

Arguments

  • range - [required] The cells Excel checks.
  • criteria - [required] The value or rule that decides which cells count.

COUNTIF vs Other Functions

Function What it does Use it when
COUNTIF Counts with one condition You only need one rule
COUNTIFS Counts with multiple conditions You need more than one rule at the same time
COUNT Counts numbers You want all numeric entries with no condition
COUNTA Counts non-empty cells You want all filled cells with no condition

Using the COUNTIF Function

COUNTIF is good for simple filtered questions. How many people answered Yes? How many scores are above 80? How many product names start with North? Those are all single-condition questions, which is exactly where COUNTIF fits best.

Microsoft notes that the criteria can be a number, expression, cell reference, or text string. That means values like 32, ">32", B4, and "apples" are all valid. Wildcards are supported too. The question mark ? matches one character, and the asterisk * matches any sequence of characters. If you need to match a real question mark or asterisk, put a tilde ~ in front of it.

Another practical detail is data quality. Microsoft points out that extra spaces and hidden characters can make text matches behave unexpectedly. If a COUNTIF result looks wrong, trimming or cleaning the source data is often the fix.

Example 1 - Count one exact text match

This example uses a simple label like Yes, which is a common pattern in surveys, checklists, and status columns. Excel checks each cell in the range and adds 1 to the count every time it finds that exact word.

The result is a quick tally of one category without filtering the list by hand. That is why this pattern is so common for Done, Pending, Pass, Fail, and similar labels.

=COUNTIF(A1:A10,"Yes") // Counts how many cells contain Yes.
Check Answer
Challenge #1
Target: Sheet1!D1

Count the Yes entries in the status list.

Example 2 - Count values above 80

Here the condition is not a word but a threshold rule. Instead of counting one exact value, Excel checks which numbers are greater than 80 and counts only those rows.

This is useful for targets and cutoffs because it answers a question like "how many passed the goal?" rather than "what is the average?" The formula is simple, but the meaning is very practical.

=COUNTIF(B1:B10,">80") // Counts how many values are greater than 80.
Check Answer
Challenge #2
Target: Sheet1!D2

Count the scores that are above the target value.

Example 3 - Count entries that start with North

This example is useful when labels share a pattern but are not identical. Values like North East and North West should usually be counted together, even though the full text is different.

The wildcard lets one rule catch all of those related labels. That makes the count more flexible and saves you from writing separate formulas for each variation.

=COUNTIF(A1:A10,"North*") // Counts values that start with North.
Check Answer
Challenge #3
Target: Sheet1!D3

Count the region names that start with North.

Example 4 - Use a cell as the criteria

In this setup, the condition comes from another cell instead of being typed directly into the formula. That means the same formula can count different categories depending on what the user selects.

This is a useful report pattern because the worksheet becomes easier to reuse. Change the criteria cell, and the count updates automatically.

=COUNTIF(A1:A10,C1) // Uses the value in C1 as the condition.
Check Answer
Challenge #4
Target: Sheet1!D4

Count how many times the value in C1 appears.

Conclusion Recap

COUNTIF is great for quick counting jobs. In this lesson, it counted exact words, numbers above a limit, text that starts with a word, and values based on a cell rule.

You give Excel one condition, and it tells you how many cells match it. That is why COUNTIF is so useful for simple reports, checklists, and summary boxes.

  • Main job: COUNTIF counts cells that match one condition.
  • Flexible criteria: You can use text, numbers, operators, wildcards, or cell references.
  • Wildcard support: ? matches one character and * matches many.
  • Good for quick filtered counts: It works well for statuses, labels, thresholds, and text patterns.
  • Watch out for messy text: Extra spaces and hidden characters can affect text matches.
  • Next step: Use COUNTIFS when one condition is not enough.
Tactical Arena
Share COUNTIF Function!

Tell your friends about this post

Discussion

ExcelClash is an interactive platform designed to level up your Excel skills through real-world exercises and challenges. Sharpen your logic, solve real spreadsheet problems, and learn faster.

© 2026 ExcelClash, Inc. All rights reserved.