Excel COUNTIF function: count cells that meet a condition

Updated October 29, 2026 · 3 min read

COUNTIF counts the cells in a range that meet one condition. =COUNTIF(B2:B7,">500") counts sales over 500. =COUNTIF(E2:E7,"East") counts rows in the East region.

The examples use this small sales table, the same one in the practice box below.

A RepB SalesD TargetE Region
2Dana1,2501,000East
3Luis8301,000West
4Priya2,1001,000East
5Marcus4751,000North
6Jen9901,000West
7Omar1,6001,000East

Syntax

=COUNTIF(range, criteria)

The criteria can be a number, text, a cell or a comparison in quotes.

Examples

FormulaResultWhat it counts
=COUNTIF(B2:B7,">500")5Sales over 500
=COUNTIF(B2:B7,">1000")3Sales over 1,000
=COUNTIF(E2:E7,"East")3Rows in East
=COUNTIF(E2:E7,"West")2Rows in West

Using a cell in the condition

To count sales above the target in D2, join the operator to the cell with &: =COUNTIF(B2:B7,">"&D2). Writing ">D2" looks for the text "D2" and returns 0.

Two conditions: COUNTIFS

=COUNTIFS(E2:E7,"East",B2:B7,">1000") counts East sales over 1,000. Add range and condition pairs for each rule. All ranges must be the same size.

Common mistakes

  • Using COUNT, which counts every number and ignores the condition.
  • Forgetting the quotes around ">500".
  • Typos in text conditions. "east " with a trailing space won't match "East". Clean the data with TRIM first.

Try it: Sales over 500

Count how many reps sold more than 500. Put the count in B8.

B8

Graded live, like a real Excel test. Press New numbers to prove you didn't memorize the answer. More practice

Questions people ask

Is COUNTIF case sensitive?

No. "east" and "East" match the same cells.

Can COUNTIF use wildcards?

Yes. =COUNTIF(A2:A7,"J*") counts names that start with J. Use ? for a single character.

Practice on a real spreadsheet

CellReady grades your formula the moment you press Enter and tells you why a wrong answer is wrong. The first 7 lessons are free, with no sign-up to start.

Start lesson one

Related guides

Excel SUMIF function: add only the rows you want

How to use SUMIF in Excel, the argument order that trips people up, using cell references in the condition, and a live exercise.

Excel IF function: return one value or another

How the Excel IF function works, with text and number results, AND and OR, nested IFs, the #NAME? mistake, and a live exercise.

Excel formulas cheat sheet for job tests

A one-page cheat sheet of the Excel formulas that show up on pre-employment tests, with the syntax, a real example and the mistake to avoid for each.