To average the numbers that belong to one category — the mean order value for the West region, the average score per class — use AVERAGEIF. It averages only the rows that match your condition, ignoring the rest.
The example
Orders by region. We want the average West order.
| A | B | C | E | F | ||
|---|---|---|---|---|---|---|
| 1 | Rep | Region | Amount | Region | Avg | |
| 2 | Ana | West | $120 | West | $150 | |
| 3 | Ben | East | $90 | |||
| 4 | Cy | West | $180 | |||
| 5 | Dot | East | $70 | |||
| 6 | Eve | West | $150 |
The formula
The average West order:
How it works
AVERAGEIF averages only the matching rows:
- The first range,
B2:B6, is tested against the criteria "West". - For every row that matches, AVERAGEIF takes the value from the third range,
C2:C6. - It sums those matching values and divides by how many there were —
(120+180+150)/3 = 150. - Non-West rows are ignored entirely; they don’t affect the count or the total.
Two or more conditions? Use AVERAGEIFS — note the average range comes first: =AVERAGEIFS(C2:C6, B2:B6, "West", D2:D6, "Widget").
Try it: interactive demo
Pick a region; see its average order value.
Variations
Average with two conditions
AVERAGEIFS — average range first:
Average greater than a value
Criteria can be a comparison:
Average ignoring zeros
Exclude zero values from the mean:
Pitfalls & errors
#DIV/0! No rows matched the criteria, so there was nothing to average. Check spelling and that the group actually exists.
AVERAGEIF skips text and blanks automatically in the average range — but a row counts only if its criteria cell matches. Empty value cells in matching rows are ignored, not treated as 0.
AVERAGEIFS reverses the argument order. In AVERAGEIFS the average range is first; in AVERAGEIF it’s last. Mixing them up returns wrong results.
Practice workbook
Frequently asked questions
How do I average values by category in Excel?
Why does AVERAGEIF return #DIV/0!?
How do I average ignoring zeros or blanks?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class