AVERAGEIF(range,criteria,[average_range])
=AVERAGEIF(C5:C15,">0")
The AVERAGEIF function can be used to calculate the average of cells in a range that meet a certain criteria. For example, this formula returns the average of the prices in C5:C15 if the prices are greater than $0.
=AVERAGEIF(D5:D15,">=2",C5:C15)
The AVERAGEIF function can also be used to calculate the average of a range based on criteria from another range. For example, this formula returns the average number of bedrooms in C5:C15 if the bedrooms entered in the cells in D5:D15 are 2 or greater.
=AVERAGEIF(D5:D15,">=3",C5:C15)
The AVERAGEIF function can also be used to calculate the average of a range based on criteria from another range. For example, this formula returns the average number of bedrooms in C5:C15 if the bedrooms entered in the cells in D5:D15 are 3 or greater.
The AVERAGEIF function is used to calculate the average of a range of cells that meet a certain criteria. It requires two arguments, range and criteria, while the average_range argument is optional. AVERAGEIF ignores empty cells and cells containing TRUE or FALSE values, and returns a #DIV/0! error if no cells meet the criteria or the range is blank or a text value.