AVERAGEIF Function
Averages the cells that meet one condition.
Category
Statistical
Available in
Excel 2007+, Microsoft 365
Returns
A number
Overview
AVERAGEIF checks each cell in a range against a condition and averages the matching values — from the same range, or from a parallel range.
Criteria can be a value ("North", 50000), a comparison in quotes (">=50000", "<>North"), a comparison joined to a cell (">="&F2), or a pattern with wildcards — * for any characters, ? for one character ("A*", "?d"). Text matching ignores upper/lower case.
Syntax
Arguments
| Argument | Required? | What it does |
|---|---|---|
| range | Yes | The cells to test. |
| criteria | Yes | The condition, such as "North" or ">50000". |
| average_range | No | The cells to average, the same size as range. Leave it out to average range itself. |
Examples
Example 1 — Average by region and above a threshold
The first two test the Region column; the third tests the sales themselves.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Rep | Region | Sales | Measure | Result |
| 2 | Ana | North | 62000 | North | 55800 |
| 3 | Ben | South | 48500 | East | 59875 |
| 4 | Cy | North | 50000 | Over 50k | 62883.33 |
| 5 | Di | East | 71250 | ||
| 6 | Ed | South | 39800 | ||
| 7 | Fay | North | 55400 | ||
| 8 | Gus | East | 48500 |
Common mistakes
- #DIV/0! No cells matched the condition, so there's nothing to average.
- Comparison without quotes. =COUNTIF(C2:C8,>50000) is an error. Write ">50000" in quotes, or ">"&F2 to use a cell.
- Putting the cell inside the quotes. ">F2" compares with the text "F2". Join the cell instead: ">"&F2.
Notes
- For two or more conditions, use AVERAGEIFS.
- Related functions: AVERAGEIFS, SUMIF, COUNTIF, AVERAGE.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.