Documentation/Calc Functions/COUNTIF

Function name:
COUNTIF

Category:
Statistical Analysis

Summary:
Returns the number of cells that meet with certain criteria within a cell range.

Syntax:
COUNTIF(Range; Criteria)

Returns:
Returns a non-negative integer which is the number of cells in Range that satisfy the given Criteria.

Arguments:
Range is a reference to the range of cells to which the criteria are to be applied.

Criteria is a criterion or a reference to the cell containing that criterion which can be in the form of a number, an expression, or a character string. These criteria determine which cells are counted.


 * If the Criteria is not a satisfied or valid criterion then the function returns zero.

Additional details:
The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example, to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every character with a "\" character or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in.

Examples:
A1:A10 is a cell range containing the numbers 2000 to 2009. Cell B1 contains the number 2006. In cell B2, you enter a formula:

Related LibreOffice functions:
[[Special:MyLanguage/Documentation/Calc_Functions/COUNT COUNT]

[[Special:MyLanguage/Documentation/Calc_Functions/COUNTA COUNTA]

[[Special:MyLanguage/Documentation/Calc_Functions/COUNTBLANK COUNTBLANK]

[[Special:MyLanguage/Documentation/Calc_Functions/COUNTIFS COUNTIFS]

[[Special:MyLanguage/Documentation/Calc_Functions/SUMIF SUMIF]

ODF standard:
Section 6.13.9, part 2

Equivalent Excel functions:
COUNTIF