ExcelUnpackUnpack Excel, one formula at a time.
Log inSign up

Lesson 29 · Statistics

AVERAGEIF and AVERAGEIFS in Excel

AVERAGEIF finds the average of only the rows that match. AVERAGEIFS does the same with more than one condition. Like SUMIFS, AVERAGEIFS puts the numbers to average first.

Practice this lesson →Pro lesson. The first 4 lessons are free.

What you will learn

  • Average the rows that match one condition
  • Average the rows that match two conditions

How it works

AVERAGEIF(where to look, what to look for, what to average).

AVERAGEIFS puts the range to average first, then pairs, like SUMIFS.

Formulas at a glance

=AVERAGEIF(C2:C9,"Math",D2:D9)one condition
=AVERAGEIFS(D2:D9,C2:C9,"Math",B2:B9,6)two conditions

Example

Write the formula to find the average Math score.

ABCDEF
1StudentGradeSubjectScore
2Ana6Math88Math average
3Ben7Math72Math, grade 6
4Cleo6Reading91
5Dev7Reading64Reading average
6Eli6Math80Reading, grade 7
7Fay7Math95
8Gus6Reading77

Click G2 and type =AVERAGEIF(C2:C9,"Math",D2:D9), then press Enter.

The answer is 83.75.

When to use it

  • Average Math score for one grade
  • Average order size for one region
  • Average price in one category

Common mistakes

  • Mixing up the orderAVERAGEIF: where, what, average. AVERAGEIFS: average range first, then pairs.
  • Getting #DIV/0!No rows matched. Check the spelling of what you look for.
  • Ranges of different sizesEvery range must cover the same rows.

Practice it on a real sheet

Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.

AVERAGEIF and AVERAGEIFS in Excel: how it works, with examples · ExcelUnpack