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.
- Free, no account
- Works for Excel
- Works for Google Sheets
- Works for LibreOffice Calc
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.
| Formula | Result | Why |
|---|---|---|
=COUNTIF(B2:B8,"North") | 3 | Orders 1001, 1003 and 1006. |
=COUNTIF(C2:C8,">4") | 3 | Orders of 5, 7 and 6 units. |
=COUNTIF(B2:B8,"<>North") | 4 | Every order that is not from the North. |
Common mistakes and how to fix them
- =COUNTA(B2:B8)COUNTA counts every filled cell. COUNTIF counts only the ones that match a condition.
- =COUNTIF(C2:C8,>4)The comparison must be in quotes: ">4".
- =COUNTIF(C2:C8,">=4") for “more than 4”>=4 also counts orders of exactly 4. More than 4 is ">4".
- Conditions on two columns at onceCOUNTIF takes one condition. For several, such as North and more than 4 units, use COUNTIFS (a Pro lesson).
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
- Excel formulas for beginners
- Excel SUM function practice
- AVERAGE, MIN and MAX practice
- Excel absolute reference practice
- Excel IF function practice
Where the Pro lessons go next
- Conditional totals with SUMIF
- Several conditions with SUMIFS and COUNTIFS
- Finding a row with VLOOKUP
- XLOOKUP, the modern lookup
- INDEX and MATCH
- Handling errors with IFERROR
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.
Abonvero Learn is independent and not affiliated with or endorsed by Microsoft, Google or The Document Foundation. Product names are trademarks of their respective owners. Operated by Andronykus Technologies LLC · contact@abonvero.com · Terms · Privacy