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.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Student | Grade | Subject | Score | ||
| 2 | Ana | 6 | Math | 88 | Math average | |
| 3 | Ben | 7 | Math | 72 | Math, grade 6 | |
| 4 | Cleo | 6 | Reading | 91 | ||
| 5 | Dev | 7 | Reading | 64 | Reading average | |
| 6 | Eli | 6 | Math | 80 | Reading, grade 7 | |
| 7 | Fay | 7 | Math | 95 | ||
| 8 | Gus | 6 | Reading | 77 |
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.