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)

ArgumentWhat it is
rangeThe cells to check.
criterionThe 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.

Advertising
Loading ad...

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".

Example=COUNTIF(B2:B11,"CDMX")CONTAR.SI = COUNTIF
Step 1/2

In G2, count how many orders come from Monterrey.

G2
ABCDEFGH
1OrderCitySellerAmount
2P-101MonterreyCarmen1200Orders from Monterrey
3P-102GuadalajaraJorge850Orders over 1000
4P-103CDMXCarmen2300
5P-104MonterreyLucía640
6P-105CDMXJorge1750
7P-106GuadalajaraLucía980
8P-107MonterreyJorge1500
9P-108CDMXLucía410
10P-109GuadalajaraCarmen1320
11P-110MonterreyCarmen760
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".