COUNTIF
Syntax:
COUNTIF ( cell-range , selection-criteria )
Description: Counts the number of cells in a specified range of cells, whose values meet the specified criteria.
Arguments:
Name |
Type |
Description |
---|---|---|
cell-range |
reference |
Designates the range of cells to be inspected. |
selection-criteria |
number, expression, reference, text |
Designates the cells to be counted. In the case of text, selection-criteria can consist of any comparison operator followed by the operand against which each cell's value is to be compared. selection-criteria can include one or more wildcard characters, question mark ( |
Return Type and Value: number – The number of cells in the range specified that meet the criteria.
Given that A2
, B2
, C2
, and D2
, respectively, contain the values apples
, oranges
, grapes
, and melons
COUNTIF(A2:D2,"*es")
results in 3
COUNTIF(A2:D2,"??a*")
results in 2
COUNTIF(A2:D2,"*l*")
results in 2
]