Average cells that match multiple criteria
=AVERAGEIFS(avg_rng, range1, criteria1, [range2], [criteria2], ...)
| Parameter | Description |
|---|---|
avg_rng |
The range to average. |
range1 |
The first range to evaluate. |
criteria1 |
The criteria to use on range1. |
range2 |
[optional] The second range to evaluate. |
criteria2 |
[optional] The criteria to use on range2. |
The syntax for the AVERAGEIFS function depends on the criteria being evaluated. Each separate condition will require a range and criteria. The generic
=AVERAGEIFS(avg_range,range1,criteria1) // 1 condition
=AVERAGEIFS(avg_range,range1,criteria1,range2,criteria2) // 2 conditions
In the example shown, the formulas in H5:H7 are:
=AVERAGEIFS(C5:C15,C5:C15,">0")
=AVERAGEIFS(C5:C15,C5:C15,">0",C5:C15,"<500000")
=AVERAGEIFS(C5:C15,D5:D15,">=2",E5:E15,">1")
In general, text values in criteria are enclosed in double quotes (""), and numbers are not. However, when a logical operator is included with a numbe
=AVERAGEIFS(C5:C15,D5:D15,2) // 2 bedrooms
=AVERAGEIFS(C5:C15,D5:D15,">=2") // 2+ bedrooms
Double quotes are also used for text values. For example, to average values in B1:B10 when values in A1:A10 equal "red", you can use a formula like th
=AVERAGEIFS(B1:B10,A1:A10,"red")
Enter criteria in pairs [range, criteria]. For example, to average values in A1:A10, where B1:B10 = "A", and C1:C10 > 5, use:
=AVERAGEIFS(A1:A10,B1:B10,"A",C1:C10,">5")
A value from another cell can be included in criteria using concatenation. In the example below, AVERAGEIFS will return the average of numbers in A1:A
=AVERAGEIFS(A1:A10,A1:A10,"<"&B1) // average values less than B1