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 (?) and asterisk (*). A question mark matches any single character; an asterisk matches any sequence of characters. To search for a question mark, asterisk, or tilde character, prefix that character with a tilde (~).

Return Type and Value: number – The number of cells in the range specified that meet the criteria.

example:

Given that A2, B2, C2, and D2, respectively, contain the values apples, oranges, grapes, and melonsCOUNTIF(A2:D2,"*es") results in 3COUNTIF(A2:D2,"??a*") results in 2COUNTIF(A2:D2,"*l*") results in 2]