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.

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 is the standard COUNTIF pattern for words like Yes, No, Done, or Pending.

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

Count how many cells in A1:A10 have the word "Yes". Formula: =COUNTIF(A1:A10,"Yes").

Example 2 - Count values above 80

Comparison operators turn COUNTIF into a quick threshold checker.

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

Count how many numbers in B1:B10 are greater than 80. Formula: =COUNTIF(B1:B10,">80").

Example 3 - Count entries that start with North

The wildcard makes it possible to count several similar labels with one rule.

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

Count every cell in A1:A10 that starts with "North". Formula: =COUNTIF(A1:A10,"North*").

Example 4 - Use a cell as the criteria

This is useful in a reusable report because the tally can change when the criteria cell changes.

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

Count how many times the value in C1 appears in A1:A10. Formula: =COUNTIF(A1:A10,C1).

Conclusion Recap

  • 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
Select Scenario:
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.