# COUNTIF in Google Sheets: syntax and examples

URL: https://goingstellar.ro/reference/sheets/countif/

COUNTIF counts how many cells in a range match one criterion. The criterion can be a value, a comparison in quotes such as ">=10", or a pattern with wildcards. For two or more conditions use COUNTIFS.

## Syntax

```
COUNTIF(range, criterion)
```

## Arguments

- `range` (range, required: yes): The cells to test.
- `criterion` (any, required: yes): The condition: a value, a comparison like ">=10", or a pattern with * and ?.

## Examples

The examples use this table, starting in A1:

| Region | Product | Qty | Status |
|---|---|---|---|
| North | Lamp | 12 | Shipped |
| South | Chair | 0 | Pending |
| North | Stand | 7 | Shipped |
| East | Tray | 40 | Returned |
| North | Lamp | 5 | Pending |

```
=COUNTIF(A2:A6, "North")
```

Result: `3`

Rows from one region. Text is matched in full, not as a fragment. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=COUNTIF(C2:C6, ">=10")
```

Result: `2`

Quantities of 10 or more. The operator goes inside the quotes. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=COUNTIF(B2:B6, "L*")
```

Result: `2`

Wildcard: products that start with L. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=COUNTIF(A2:A6, "<>North")
```

Result: `2`

Everything except one value. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=COUNTIF(C2:C6, ">"&AVERAGE(C2:C6))
```

Result: `1`

Join an operator to a calculation with &: quantities above the average. Run in a Google Sheet (English US locale) on 2026-11-29.

## Common errors

- The match ignores case: "north" counts the same cells as "North".
- An operator must sit inside the quotes. To compare with a cell, join them: ">"&C2.
- "=0" counts cells holding zero, not blank cells. Use "" to count empty cells.
- Calling it with only the range returns #N/A. It always needs both arguments.

## Compared with Excel

Same syntax and behavior as Excel COUNTIF.

## Questions and answers

### Can COUNTIF check two conditions?

No, it takes one criterion. COUNTIFS accepts several range and criterion pairs, and all of them must hold.

## Related functions

- [COUNTIFS](https://goingstellar.ro/reference/sheets/countifs/)
- [SUMIF](https://goingstellar.ro/reference/sheets/sumif/)
- [COUNTA](https://goingstellar.ro/reference/sheets/counta/)
- [SUMIFS](https://goingstellar.ro/reference/sheets/sumifs/)
- [FILTER](https://goingstellar.ro/reference/sheets/filter/)

## Sources

- [COUNTIF (Docs Editors Help)](https://support.google.com/docs/answer/3093480)

