Hands-On Excel

Hands-On Excel Challenges COUNTIF

Excel COUNTIF practice

=COUNTIF(C2:C11, "Shipped") counts the cells in C2:C11 that say Shipped. For a comparison, the whole condition goes in quotes: =COUNTIF(B2:B11, ">100").

CoreAbout 3 minutesFree, no sign-upBy Updated

Try it yourself

08 · COUNTIF · Core

Count the ones that match

In F2, count the orders with the status Shipped. In F3, count the orders worth more than $100.

COUNTIF(where to look, what to count). The condition goes in quotes, comparisons too: "Shipped", ">100".

orders.xlsx
Ready

Write in the green cells, then press Check. Click a cell while typing to insert it, drag to select a range, F4 adds $, Esc cancels.

The guide · COUNTIF

Syntax

=COUNTIF(range, criteria)

Conditions you can use

CriteriaCounts cells that…
"Shipped"say Shipped (not case-sensitive)
">100"are more than 100
">=100"are 100 or more
"<>Cancelled"say anything except Cancelled
"*ship*"contain "ship" anywhere
F1equal whatever is in F1
">"&F1are more than the number in F1

Why the quotes?

COUNTIF's condition is a piece of text that Excel reads for you. ">100" means "more than 100". Without the quotes, >100 isn't text or a number, so Excel can't read the formula at all. To compare with a cell, join the operator and the cell: ">"&F1. Writing ">F1" compares with the letters F1.

Common mistakes

FAQ

How do I count cells with specific text in Excel?
Use COUNTIF with the text in quotes, for example =COUNTIF(C2:C11,"Shipped"). It counts every cell in the range that says Shipped.
How do I count cells greater than a number?
Put the comparison in quotes: =COUNTIF(B2:B11,">100"). For 100 or more, use ">=100".
Why does my COUNTIF return 0?
Usually the range points at the wrong column, the text in the condition is spelled differently, or the cells contain extra spaces. Check one cell that should match against the condition.
Is COUNTIF case-sensitive?
No. "shipped", "Shipped" and "SHIPPED" all match the same cells.

All challenges

  1. 01 Add it upSUM Starter · 3 min
  2. 02 Find the averageAVERAGE Starter · 3 min
  3. 03 Write once, fill downRelative references Starter · 3 min
  4. 04 Lock it with $Absolute references Core · 3 min
  5. 05 Percent of a totalPercentages Starter · 3 min
  6. 06 Select to the end in one moveCtrl + Shift + arrow Core · 3 min
  7. 07 Pass or fail?IF Core · 3 min
  8. 08 Count the ones that matchCOUNTIF Core · 3 min
  9. 09 Add up with two conditionsSUMIFS Core · 3 min
  10. 10 Look it upVLOOKUP Core · 3 min
  11. 11 Find the right bracketVLOOKUP approximate match Core · 3 min
  12. 12 XLOOKUP, the modern wayXLOOKUP Core · 3 min
  13. 13 INDEX and MATCH togetherINDEX + MATCH Advanced · 3 min
  14. 14 Catch the error, not the bugIFERROR Core · 3 min
  15. 15 Split first and last namesLEFT, MID + FIND Core · 3 min
  16. 16 Mistake hunt: #N/A everywhereFixing #N/A Core · 3 min

Pro · coming soon

From first formula to job-ready.

100+ challenges on lookups, pivot tables, dates and text cleanup, an interview track modeled on the Excel tests employers use, and your progress saved across devices.

$29 one-time · early-bird price

You won't be charged today.

You're early!

Pro isn't open yet. We're building it right now. Leave your email and we'll hold the $29 early-bird price for you and tell you the day it launches.

We'll email you a link to confirm, then one email when Pro launches. Privacy