Syntax, a live playground, a measured criteria gallery, the case-insensitivity surprise, and a sourced error library: count cells that meet one condition.
Counts cells that meet one criteria. Text criteria are case-insensitive and support the wildcards * and ?.
COUNTIF counts cells that meet one criteria. It is case-insensitive and supports wildcards — two facts that surprise people. Every row was measured live in HyperFormula on the sample table. Click any row to load it.
| Expression | Result | Why |
|---|---|---|
| =COUNTIF(A2:A5,"Apple") | 2 | Count cells equal to Apple |
| =COUNTIF(A2:A5,"*an*") | 1 | Wildcard *an* matches Banana only |
| =COUNTIF(B2:B5,">150") | 2 | Count amounts > 150 (200, 300) |
| =COUNTIF(B2:B5,">=150") | 3 | Inclusive: 150, 200, 300 |
| =COUNTIF(D2:D5,"East") | 2 | Count the East region |
| =COUNTIF(A2:A5,"<>Apple") | 2 | Not-equal: Banana and Cherry |
| =COUNTIF(A2:A5,"?pple") | 2 | ? matches one character (Apple) |
| =COUNTIF(A2:A5,"apple") | 2 | Case-insensitive: apple = Apple |
| Expression | Result | Why |
|---|---|---|
| =COUNTIF(A2:A5,"apple") | 2 | Case-insensitive: lowercase apple still matches Apple |
| =COUNTIF(A2:A5,"Apple") | 2 | Same count — case does not matter |
| =COUNTIF(A2:A5,"*") | 4 | Wildcard * counts every non-empty text cell |
| =COUNTIF(B2:B5,">150") | 2 | Numeric comparison criteria |
* = any run of characters, ? = exactly one character. Escape a literal wildcard with ~ (e.g. ~*).Edit the table or type any formula — the engine evaluates instantly. Load a preset to see COUNTIF match text, operators and wildcards, and prove case-insensitivity.
8 failure patterns mined from actual user reports on Reddit, Stack Overflow and Super User — each with the authentic symptom, root cause, a fix, and a runnable formula. Not textbook theory.
COUNTIF is available across modern Excel, Google Sheets and LibreOffice. It has been in Excel since 2003.
| Platform | Support | Notes | Gotcha |
|---|
COUNTIF is one piece. The full course walks the toolkit end to end with live, measured examples.