COUNTIF function in Excel
Counts the number of cells within a range that meet the given criteria
=COUNTIF(range, criteria)COUNTIF syntax and parameters
Two arguments, two required.
- rangerangeRequired
The group of cells you want to count. Range can contain numbers, arrays, a named range, or references that contain numbers. Excel ignores blank and text values. Learn how to select ranges in a worksheet
- criteriaanyRequired
A number, expression, cell reference, or text string that determines which cells COUNTIF counts. For example, you can use a number like 32, a comparison like ">32", a cell like B4, or a word like "apples". COUNTIF uses only a single criteria. Use COUNTIFS if you want to use multiple criteria.
COUNTIF examples
Formulas you'll actually reuse.
How many orders came from the West region:
=COUNTIF(A2:A200, "West")Result
47Deals above the average — build the criterion with &:
=COUNTIF(C2:C200, ">" & AVERAGE(C2:C200))Result
68
COUNTIF in Google Sheets
Same name — your formula ports as-is.
Try COUNTIF in the playground
Edit the example — nothing to install.
Preloaded with the COUNTIF formula from Example 1 — change anything and watch it respond.
Related functions
More ways Excel gets this done.
- AVERAGEIFReturns the average (arithmetic mean) of all the cells in a range that meet a given criteriaStatisticalGoogle Sheets
- COUNTBLANKCounts the number of blank cells within a rangeStatisticalGoogle Sheets
- COUNTIFSCounts the number of cells within a range that meet multiple criteriaStatisticalGoogle Sheets
- FORECAST.LINEARReturns a future value based on existing valuesStatisticalGoogle Sheets
- GAMMALNReturns the natural logarithm of the gamma function, Γ(x)StatisticalGoogle Sheets
- GAMMALN.PRECISEReturns the natural logarithm of the gamma function, Γ(x)StatisticalGoogle Sheets