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.
Syntax =AVERAGEIFS(average_range, criteria_range1, criteria1, ...)
=AVERAGEIFS(C2:C5,A2:A5,"Austin",B2:B5,"Electric")Arguments
| Name | Required | What to pass |
|---|---|---|
| average_range | Required | The numbers to average. This argument comes first, which is the reverse of AVERAGEIF. |
| criteria_range1 | Required | The first range to test. It must be the same shape as average_range. |
| criteria1 | Required | The test for that range. |
| criteria_range2 | Optional | More 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
| A | B | C | |
|---|---|---|---|
| 1 | City | Category | Amount |
| 2 | Austin | Electric | 143.60 |
| 3 | Dallas | Electric | 110.00 |
| 4 | Austin | Gas | 96.20 |
| 5 | Austin | Electric | 118.45 |
| 6 | 131.025 |
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.