AVERAGEIF function
AVERAGEIF returns the average (arithmetic mean) of all the cells in a range that meet the given criteria.
Syntax
AVERAGEIF(range, criteria, [average_range], ...)
- range is the range to be averaged. It can be one or more cells including numbers or names, arrays, or references that have numbers.
- criteria is the criteria that defines which cells are averaged. The criteria can be a number, expression, cell reference, or text.
- average_range (optional) is the actual set of cells to be averaged. If not set, range is used.
Note: The average_range value can be different from the range
value. The actual cells that are averaged start from the top cell in average_range, and then include
the cells that correspond in size and shape to range.
Example
=AVERAGEIF(A2:A5,"<150")
Calculates the average of all numbers in cells A2 through A5 that are less than 150.