Formulas and Functions

Table Of Contents
Chapter 10 Statistical Functions 233
AVERAGEIF
The AVERAGEIF function returns the average (arithmetic mean) of the cells in a range
that meet a given condition.
AVERAGEIF(test-values, condition, avg-values)
 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.
 avg-values: An optional collection containing the values to be averaged. avg-values
is a reference to a single range of cells or an array, which may contain only numbers,
numeric expressions, or Boolean values.
Usage Notes
Each value is compared to  condition. If the value meets the conditional test, the
corresponding value in avg-values is included in the average.
 avg-values and test-values (if specied) must be the same size.
If  avg-values is omitted, test-values is used for avg-values.
If  avg-values is omitted or is the same as test-values, test-values can contain only
numbers, numeric expressions, or Boolean values.
Examples
Given the following table:
=AVERAGEIF(A2:A13, “<40”, D2:D13) returns approximately 57429, the average income of people under
the age of forty.
=AVERAGEIF(B2:B13, “=F”, D2:D13) returns 62200, the average income of females (indicated by an “F” in
column B).
=AVERAGEIF(C2:C13, “S”, D2:D13) returns 55800, the average income of people who are single
(indicated by an “S” in column C).
=AVERAGEIF(A2:A13, “>=40”, D2:D13) returns 75200, the average income of people who are forty or older.