Google Sheets COUNTIF function
Counts the cells in a range that meet a condition. In Spanish Sheets it is called CONTAR.SI.
Syntax
English Sheets
=COUNTIF(range, criterion)
Spanish Sheets (Mexico locale)
=CONTAR.SI(intervalo, criterio)
Spanish Sheets (Spain, Latin America)
=CONTAR.SI(intervalo; criterio)
| Argument | What it is |
|---|---|
| range | The cells to check. |
| criterion | The condition: "Paid", ">1000", "*@gmail.com"… |
Example
COUNTIF(range, criterion) counts the cells that meet a criterion. It can be a text, like "Monterrey", or a comparison in quotes, like ">1000".
=COUNTIF(B2:B11,"Monterrey")
Common mistake
To compare with a cell, keep the operator in quotes and join the cell with &: ">="&F2. Writing ">=F2" looks for the text "F2".
About Ads
This site uses Google AdSense to display ads. These ads help us keep WebHerramientas completely free. Ads are managed by Google and meet strict security and privacy standards.
Ads help us keep WebHerramientas free for everyone
Practice COUNTIF
Type the formula in the sheet and check it instantly. Spanish or English function names both work. See all lessons
COUNTIF
COUNTIF(range, criterion) counts the cells that meet a criterion. It can be a text, like "Monterrey", or a comparison in quotes, like ">1000".
In G2, count how many orders come from Monterrey.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Order | City | Seller | Amount | ||||
| 2 | P-101 | Monterrey | Carmen | 1200 | Orders from Monterrey | |||
| 3 | P-102 | Guadalajara | Jorge | 850 | Orders over 1000 | |||
| 4 | P-103 | CDMX | Carmen | 2300 | ||||
| 5 | P-104 | Monterrey | Lucía | 640 | ||||
| 6 | P-105 | CDMX | Jorge | 1750 | ||||
| 7 | P-106 | Guadalajara | Lucía | 980 | ||||
| 8 | P-107 | Monterrey | Jorge | 1500 | ||||
| 9 | P-108 | CDMX | Lucía | 410 | ||||
| 10 | P-109 | Guadalajara | Carmen | 1320 | ||||
| 11 | P-110 | Monterrey | Carmen | 760 | ||||
| 12 |
Tip: while typing, click a cell or drag across several to insert their reference.
Frequently asked questions
- What is COUNTIF called in Spanish?
- In Spanish Google Sheets it is CONTAR.SI. The formula =COUNTIF(B2:B11,"Monterrey") is written =CONTAR.SI(B2:B11;"Monterrey") (or with commas under a Mexico locale).
- Why does COUNTIF use semicolons in some spreadsheets?
- It depends on each spreadsheet's locale, under File > Settings. Where the comma is the decimal mark (Spain, much of South America), arguments are separated by semicolons. Mexico and United States locales use commas.
- What is the most common COUNTIF mistake?
- To compare with a cell, keep the operator in quotes and join the cell with &: ">="&F2. Writing ">=F2" looks for the text "F2".