Returns the number of elements within a cell range that meet a certain criteria.
Sample Usage
COUNTIF(B1:B6,">5")
COUNTIF(C5:C10, "Passed")
Syntax
COUNTIF(range, criteria)
- range - The cells to which the criteria is applied.
- criteria - The pattern or test to apply to the range.
Examples
COUNTIF(B1:B6,">5") counts the elements in the range that are less than 5.
COUNTIF(C5:C10, "Passed") counts the elements in the range that match with the string "Passed".
Notes
- Ensure that criteria is enclosed in quotation marks.
- criteria is not case sensitive.
- To perform conditional counts with multiple criteria, use COUNTIFS.
- criteria can contain wildcard characters. Currently, the use of asterisk (*) is supported.
- An asterisk matches any sequence of characters.
- To match an actual asterisk, type a tilde (~) before the character. For example: (~*).