Google Sheets AVERAGEIF function
Averages the values in a range that meet one condition.
Syntax
=AVERAGEIF(range, criterion, [average_range])
range | The cells to test. |
|---|---|
criterion | The condition to match. |
average_range | Optional. The cells to average. If left out, range is averaged. |
Try it
Edit the formula and the result updates instantly. Click a cell to add its reference.
Q1 sales
Result: 308.333333333
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Rep | Region | Product | Units | Revenue |
| 2 | Ana | East | Pens | 120 | 240 |
| 3 | Ben | West | Paper | 80 | 400 |
| 4 | Cara | East | Paper | 45 | 225 |
| 5 | Dev | North | Pens | 200 | 400 |
| 6 | Ana | East | Ink | 30 | 450 |
| 7 | Ben | West | Pens | 95 | 190 |
| 8 | Cara | East | Ink | 12 | 180 |
| 9 | Dev | North | Paper | 60 | 300 |
Examples
These use the sample sheet above.
→ 308.333333333
Average revenue per paper sale.
→ 53.6666666667
Average units for the smaller sales.
Tips & common mistakes
- If nothing matches, AVERAGEIF returns #DIV/0!. Wrap it in IFERROR for a clean report.