Syntax
=COUNTIF(range, criteria)Arguments
| Argument | Required | Description |
|---|---|---|
range | Required | The cells to check |
criteria | Required | The condition, like 5, ">10", "apple" or "a*" |
How to use COUNTIF
COUNTIF takes 2 required arguments. Type =COUNTIF( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.
Examples
Each result below was calculated by the SheetsBat formula engine.
=COUNTIF(A1:A4, ">2")Result Data in the sheet
| A | |
|---|---|
| 1 | 1 |
| 2 | 3 |
| 3 | 5 |
| 4 | x |
=COUNTIF(A1:A3, "a*")Result Data in the sheet
| A | |
|---|---|
| 1 | apple |
| 2 | avocado |
| 3 | pear |
Related statistical functions
- CORRELReturns the correlation coefficient of two sets of numbers.
- COUNTCounts how many numbers are in a list or range.
- COUNTACounts the cells and values that are not empty.
- COUNTBLANKCounts the empty cells in a range, including cells holding empty text.
- COUNTIFSCounts the cells that meet all of several conditions.
- COVARIANCE.PReturns the population covariance of two sets of numbers.
- COVARIANCE.SReturns the sample covariance of two sets of numbers.
- DEVSQReturns the sum of squared deviations of the numbers from their mean.
- EXPON.DISTReturns the exponential distribution.