Apple iWork '09 User Manual
Page 249
![background image](/manuals/546881/249/background.png)
Chapter 10
Statistical Functions
249
COUNTIFS(test-values, condition, test-values…, condition…)
Â
test-values: A collection containing values to be tested. test-values is a collection
containing any type of value.
Â
condition: An expression that results in a logical TRUE or FALSE. condition is an
expression that can contain anything as long as the result from comparing condition
to a value in test-values can be expressed as a Boolean value of TRUE or FALSE.
Â
test-values…: Optionally include one or more additional collections containing
values to be tested. Each test-values collection must be followed immediately with a
condition expression. This pattern of test-values, condition can be repeated as many
times as needed.
Â
condition…: If an optional collection of test-values is included, an expression that
results in a logical TRUE or FALSE. There must be one condition following each
test-values collection; therefore, this function will always have an odd number of
arguments.
Usage Notes
Each value in
Â
test-values is compared to the corresponding condition. If the
corresponding values in each collection meet the corresponding conditional tests,
the count is increased by 1.
Examples
Given the following table:
=COUNTIFS(A2:A13,”<40”,B2:B13,”=M”) returns 4, the number of males (indicated by an “M” in column
B) under the age of forty.
=COUNTIFS(A2:A13,”<40”,B2:B13,”=M”,C2:C13,”=S”) returns 2, the number of males who are single
(indicated by an “S” in column C) and under the age of forty.
=COUNTIFS(A2:A13,”<40”,B2:B13,”=M”,C2:C13,”=M”) returns 2, the number of males who are married
(indicated by an “M” in column C) and under the age of forty.
=COUNTIFS(A2:A13,”<40”,B2:B13,”=F”) returns 3, the number of females (indicated by an “F” in column
B) who are under the age of forty.