Function · Statistical

Excel AVERAGEIFS function

The Excel AVERAGEIFS function averages numbers that pass every test you give it. Austin Electric, $143.60 and $118.45, averages $131.025. Dallas is left out.

Excel 2007 and later. Also in Excel for the web and Google Sheets.

Syntax =AVERAGEIFS(average_range, criteria_range1, criteria1, ...)

AVERAGEIFS
=AVERAGEIFS(C2:C5,A2:A5,"Austin",B2:B5,"Electric")

Arguments

NameRequiredWhat to pass
average_rangeRequiredThe numbers to average. This argument comes first, which is the reverse of AVERAGEIF.
criteria_range1RequiredThe first range to test. It must be the same shape as average_range.
criteria1RequiredThe test for that range.
criteria_range2OptionalMore pairs of ranges and tests. A row has to pass every test.

Examples

Austin Electric only

=AVERAGEIFS(C2:C5,A2:A5,"Austin",B2:B5,"Electric")

Result $131.025

=AVERAGEIFS(C2:C5,A2:A5,"Austin",B2:B5,"Electric")C6
Utilities
ABC
1CityCategoryAmount
2AustinElectric143.60
3DallasElectric110.00
4AustinGas96.20
5AustinElectric118.45
6131.025
A picture of the sheet, not a live calculator. The amount range is the first argument. AVERAGEIF puts the test range first.

AVERAGEIFS keeps a row only when every test passes. Austin and Electric together are the two bills $143.60 and $118.45, average $131.025. Dallas Electric fails the city. Austin Gas fails the category. Neither is a partial credit.

The argument order is the trap if you already know AVERAGEIF. There, the range you test comes first and the numbers are optional. Here, the numbers come first and every test is a pair after that. The ranges have to line up row for row. Text tests ignore case. A sum of the same rows is SUMIFS, with the same argument order.