Counts the number of cells in the specified range that meet the specified criterion.
Syntax Copy Code |
---|
COUNTIF( Reference r, Criterion c ) → Integer |
The criterion can be a number or a text value. If c is a number, the cells are counted if they contain numbers equal to the criterion or text values equal to the text representation of the criterion. If c is a string that starts with a comparison operator ('<=', '<>', '<', '>=', '>', '=') the cell values are counted if they satisfy the condition of the criterion. For example, the cell with value 10 will be counted if c is '<15'. Cells with text values cannot satisfy criteria with the following comparison operators: '<=', '<', '>', and '>='. Text comparison is case-insensitive.
Criteria can contain wildcard characters - the question mark (?) and the asterisk (*). A question mark matches any single character, and an asterisk matches any sequence of characters. To match blank cells use blank or empty criteria.
Formula Copy Code |
---|
=COUNTIF(A1:A5,">50") |
Function Reference
COUNT Function
COUNTA Function
COUNTIF Function