FREE LESSON 6 OF 47 · EXCEL AND GOOGLE SHEETS

Excel COUNTIF practice

COUNTIF answers “how many?” questions: how many orders came from the North, how many were bigger than 4 units, how many were anything but North. Practice it below on a real order list with instant, specific feedback.

Loading spreadsheet controls…

LESSON 6 · COUNTIF

Counting with COUNTIF

COUNTIF(range, condition) counts the cells that match. A condition can be a value, like "North", or a comparison in quotes, like ">3".

=COUNTIF(B2:B8,"North")

Identical everywhere. Wildcards such as "N*" work in all three; in LibreOffice they need Tools → Options → Calc → Calculate → Enable wildcards (on by default since 5.2).

Step 1 of 3 In G1, count how many orders are from the North region.

G1fx
Swipe to see more columns.
ABCDEFGH
1
2
3
4
5
6
7
8
9
10
Use arrow keys to move between cells and Enter to select a cell. While writing a formula, select a cell to insert its address or type the address in the formula bar.

How it works

The pattern is =COUNTIF(range, condition). It looks through the range and counts the cells that match the condition.

A text condition is written in quotes: "North". The match is not case-sensitive, so north and NORTH count too.

A comparison goes inside the quotes as well: ">4" means more than 4 and "<>North" means anything except North. To compare with a cell instead of a fixed number, join them with &: ">"&G5.

Wildcards work in text conditions: * stands for any run of characters and ? for exactly one, so "N*" counts everything starting with N.

Pattern=COUNTIF(B2:B8,"North")

Worked example

Seven orders: region in column B, units in column C.

FormulaResultWhy
=COUNTIF(B2:B8,"North")3Orders 1001, 1003 and 1006.
=COUNTIF(C2:C8,">4")3Orders of 5, 7 and 6 units.
=COUNTIF(B2:B8,"<>North")4Every order that is not from the North.

Common mistakes and how to fix them

Excel, Google Sheets and LibreOffice Calc

COUNTIF works identically in Microsoft Excel, Google Sheets and LibreOffice Calc. In LibreOffice, wildcards depend on a setting that is on by default since version 5.2 (Tools → Options → LibreOffice Calc → Calculate).

Keep going

That was the last free lesson. Learn Pro unlocks the other 41 spreadsheet lessons and every other course.

More free spreadsheet lessons

Where the Pro lessons go next

Learn Pro continues through lookups, conditional totals, text and date functions, charts and pivot tables, with capstone workbooks at the end. The same hands-on style covers Word and Google Docs, PowerPoint and Google Slides and AI skills for work.