Excel function

AVERAGEIFSfunction

Averages only the values in rows that meet every condition.

All versions
=AVERAGEIFS(D2:D9, B2:B9, "Apple", A2:A9, "<>Seoul")
Range to drag
A
B
C
D
1
2
3
4
5
6
7
8
9

Drag the corner dots to change average_range, criteria_range1, criteria_range2. Click a cell in the criteria range to use its value as the criteria. Change criteria2 to "Seoul" and only one row, Seoul apples, is left. Change criteria1 to "Melon" and nothing matches, so you get #DIV/0!. Try breaking it on purpose to see the errors.

Result

33750

average_range
D2:D9Drag a corner dot up/down to resize, sideways to change the column

The column to average. In AVERAGEIFS it comes first.

criteria_range1
B2:B9

The column checked against the first condition.

criteria1

The first condition.

criteria_range2
A2:A9

The column checked against the second condition.

criteria2

The second condition.

What is the AVERAGEIFS function?

=AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)

AVERAGEIFS averages only the values in rows that meet every condition, such as the average apple sales outside Seoul.

It adds the values of the rows that meet all the conditions while counting them, then divides the total by the count. Unlike AVERAGEIF, average_range comes first, as in SUMIFS.

Arguments

average_range
The cells to average. The first argument.
criteria_range1, criteria1
The range for the first condition and the condition.
criteria_range2, criteria2, ...
Optional. More pairs. Every criteria range must be the same size as average_range.

AVERAGEIFS examples

  1. Example 1. Average apple sales outside Seoul

    =AVERAGEIFS(D2:D9, B2:B9, "Apple", A2:A9, "<>Seoul")

    The average of Daegu apples 30000 and Busan apples 37500 is 33750. This is how the sheet first opens.

  2. Example 2. Average quantity of Seoul orders of 10 or more

    =AVERAGEIFS(C2:C9, A2:A9, "Seoul", C2:C9, ">=10")

    Of Seoul's 30, 8 and 40, the 8 is left out; the average of 30 and 40 is 35. average_range and a criteria range can be the same column.

  3. Example 3. No matching rows

    =AVERAGEIFS(D2:D9, A2:A9, "Seoul", B2:B9, "Coffee")

    Seoul has no coffee orders, so the count is 0 and the result is #DIV/0!.

Common mistakes

FAQ

Blank cells in average_range?
Cells that are not numbers are left out; the steps mark them as left out.
How many conditions?
Up to 127 range/criteria pairs.
Why does it differ from AVERAGEIF?
AVERAGEIFS uses only rows that meet every condition. With one condition the results are the same.