Templates, guides & honest tool reviews for small business

Monday, November 30, 2026

AVERAGEIFS in Excel: Average Only the Rows That Qualify

Section: Excel & Google Sheets

AVERAGEIFS in Excel - explanatory illustration for AVERAGEIFS in Excel
Illustration: AVERAGEIFS in Excel

AVERAGEIFS in Excel averages the cells that meet several conditions at once. =AVERAGEIFS(B2:B5,B2:B5,">70",B2:B5,"<90") averages only the quiz grades between 70 and 90, and returns 80.5 on Microsoft's sample data. It is the third member of the family, after SUMIFS and COUNTIFS, and it follows the same shape: the range to calculate comes first, then pairs of a range to test and the test. This guide covers the syntax, the rules Microsoft states, the published examples, why a blank or text cell changes the answer, and the error that appears when nothing matches.

What AVERAGEIFS returns

Microsoft describes it as returning the arithmetic mean of all cells that meet multiple criteria. The average is taken over the cells in the average range whose matching cells in every criteria range pass their test.

The result is not the average of the criteria columns, and it is not the average of every row. Only the rows that pass are averaged, and the count underneath the division is the number of those rows.

The syntax

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

  • average_range comes first and holds the numbers to average.
  • criteria_range1 and criteria1 are the first test.
  • Further pairs are optional, and Microsoft allows 1 to 127 ranges and criteria.
  • A criterion can be a number, an expression such as ">32", a cell reference or text such as "apples".
AVERAGEIFS arguments - explanatory illustration for AVERAGEIFS in Excel
AVERAGEIFS arguments (explanatory illustration, not a software screenshot).

The rules Microsoft states

AVERAGEIFS has more edges than SUMIFS, and the page lists them:

  • Every criteria range must be the same size and shape as the average range. Microsoft notes this is stricter than AVERAGEIF, where the ranges can be shaped differently.
  • An empty cell in a criteria range is treated as 0.
  • TRUE in a range evaluates as 1 and FALSE as 0.
  • Wildcards work in the criteria, with a tilde to find a literal question mark or asterisk.
  • If the average range is blank or text, or cannot be translated into numbers, the function returns #DIV/0!.

That last rule is the one to keep in mind when the data has the word Incomplete in a grade column. A text value in the average range is skipped only because the criteria exclude it first.

Microsoft's first example, and a misprint

The sample is four students with two quiz grades and a final exam grade. The first formula averages the first quiz grade between 70 and 90: =AVERAGEIFS(B2:B5,B2:B5,">70",B2:B5,"<90").

Microsoft's results table prints 75 for this formula, but the description on the same page says 80.5, and 80.5 is the right answer: the grades in that column are 75, 94, 86 and Incomplete, so the two that fall between 70 and 90 are 75 and 86, and their average is 80.5. I checked that arithmetic twice before writing it. If your sheet shows 80.5, you are not doing anything wrong.

The quiz example - explanatory illustration for AVERAGEIFS in Excel
The quiz example (explanatory illustration, not a software screenshot).

Excluding text values

The third formula on the page averages final exam grades above 80 while excluding the word Incomplete: =AVERAGEIFS(D2:D5,D2:D5,"<>Incomplete",D2:D5,">80") returns 87.5, because the grades are 87, 88, 75 and 75.

Two criteria on the same range is the normal way to build a band or to remove a label. Without the first pair, the text entry is not a number and the average would divide by the wrong count.

When nothing matches

Microsoft's second formula asks for second quiz grades above 95, and there are none: the grades are 85, 80, 93 and 75. The result is #DIV/0!, because the count of matching cells is zero and a division by zero has no answer.

Wrap the call in IFERROR if a blank is the friendlier output, but do not hide the error until you have confirmed that zero matches is expected rather than a symptom of a criteria typo.

A second example: houses

Microsoft's other example is a small list of houses with price, town, bedrooms and a garage flag: a Cozy Rambler at 230,000 in Issaquah with 3 bedrooms, a Snug Bungalow at 197,000 in Bellevue with 2, a Cool Cape Codder at 345,678 in Bellevue with 4, a Splendid Split Level at 321,900 in Issaquah with 2, and an Exclusive Tudor at 450,000 in Bellevue with 5.

  • Average price of the Bellevue houses with 3 or more bedrooms: 397,839, from 345,678 and 450,000.
  • Average price of every house in Issaquah: 275,950, from 230,000 and 321,900.

I computed both from the published table. The pattern is the one to reuse: test the town and the bedroom count, average the price column.

House prices by town - explanatory illustration for AVERAGEIFS in Excel
House prices by town (explanatory illustration, not a software screenshot).

AVERAGEIFS compared with AVERAGE and AVERAGEIF

AVERAGE takes a range and ignores text, but it cannot filter. AVERAGEIF filters on one condition and is more relaxed about range shapes. AVERAGEIFS filters on several and requires every range to match the average range exactly.

If the table is an Excel Table, the ranges resize with the data and the shape rule looks after itself.

Its siblings are worth knowing too: SUMIFS adds what AVERAGEIFS averages, and COUNTIFS counts the same rows without a calculation on them. Using all three on one table is a quick way to see a total, a count and an average that are guaranteed to describe the same set of rows.

Common problems

  • #DIV/0! when you expected a number. No row met every criterion, or the average range holds text or blanks.
  • An average that looks too low. An empty cell in a criteria range is read as 0, which can pull rows in.
  • An average that ignores rows you meant to include. The ranges differ in height, so the pairs are misaligned.
  • A text criterion that matches nothing. The criterion needs quotation marks, and a number stored as text will not match a numeric test.
  • A wildcard matching too much. "North*" also matches "Northern". Use the exact text or a stricter pattern.
  • A result that changes when the sheet is sorted. It should not. If it does, a range reference has moved with the sort.
Why AVERAGEIFS gives #DIV/0! - explanatory illustration for AVERAGEIFS in Excel
Why AVERAGEIFS gives #DIV/0! (explanatory illustration, not a software screenshot).

Questions and answers

What is the difference between AVERAGEIF and AVERAGEIFS?

AVERAGEIF takes one condition. AVERAGEIFS takes several and requires every criteria range to be the same size and shape as the average range.

Does AVERAGEIFS ignore text automatically?

It ignores rows that fail the criteria. If a text value passes the criteria, the function returns #DIV/0!, so exclude text with a criterion such as "<>Incomplete".

Can I average a column other than the one I test?

Yes, and that is the normal case: test the town and the bedrooms, average the price.

Why does an empty cell change my average?

In a criteria range an empty cell counts as 0, so it can satisfy a numeric test you did not expect it to satisfy.

Does AVERAGEIFS work in Google Sheets?

Yes, with the same argument order. Check Google's function page before copying a formula across, since the range-size rules are worth confirming there.

Official references

العربية