The AVERAGEIF function

Returns the average of the cells that meet one condition.

Syntax

AVERAGEIF(range, criteria, [average_range])
range
The cells the condition is checked against.
criteria
The condition, such as "North" or ">300".
average_range (optional)
The cells to average. If left out, range itself is averaged.

Examples

E1=AVERAGEIF(A2:A6,"North",C2:C6)
ABCDE
1RegionProductSales390
2NorthShoes500
3SouthShoes300
4NorthBags250
5NorthShoes420
6SouthBags180

In plain words: Average the sales in C2:C6 on the rows where the region in A2:A6 is North.

E1=AVERAGEIF(B2:B6,"Bags",C2:C6)
ABCDE
1RegionProductSales215
2NorthShoes500
3SouthShoes300
4NorthBags250
5NorthShoes420
6SouthBags180

Practice AVERAGEIF

Read the guide

Related functions