
Calculate the average of values that match one condition. Useful when you want the mean for one category, threshold, or label.
AVERAGEIF returns the average of values that meet one condition. It is useful when you do not want the mean for the whole dataset and only care about one group, one threshold, or one matching label.
That makes it a practical reporting function. Instead of filtering a list by hand and then averaging it, you can let one formula do both jobs at once. You tell Excel what to check, what rule to use, and which numbers should be averaged.
Finds the mean only for rows that match one rule.
Returns the average of matching values. If nothing matches, Excel returns #DIV/0!.
=AVERAGEIF(range, criteria, [average_range])
range is the part Excel checks against your rule. criteria is the rule itself. average_range is the set of values to average if it is different from the checked range.
">1000", or a cell reference.range.The difference mostly comes down to how many conditions you need and whether you want an average at all.
| Function | Main job | Use it when |
|---|---|---|
AVERAGEIF |
Average with one condition | You only need one rule |
AVERAGEIFS |
Average with multiple conditions | You need two or more rules at the same time |
AVERAGE |
Average everything | You want the mean for the full list |
SUMIF |
Sum with one condition | You want the total instead of the mean |
A common pattern is averaging one numeric column based on labels in another column. For example, you can average salaries where the department is "Sales", or average order values where the region contains the word "North". This keeps the formula readable even when the dataset grows.
Microsoft also notes a few details that help avoid mistakes. Criteria can be written as text, numbers, expressions, or cell references. That means rules like "Sales", 32, ">32", and B4 are all valid. If you omit average_range, Excel averages the matching cells from range itself.
Wildcards are useful when the text is not identical in every row. The asterisk * matches any sequence of characters, and the question mark ? matches a single character. That lets one formula catch values like North East and North West without listing each one separately.
Here the condition is a text label, so Excel checks the department column and averages the matching salary values.
=AVERAGEIF(A1:A3,"Sales",B1:B3) // Averages only the Sales rows.
Average the salaries in B1:B10 where the department in A1:A10 is "Sales". Formula: =AVERAGEIF(A1:A10,"Sales",B1:B10).
This version uses a comparison rule. Because the values being checked and averaged are in the same range, average_range is not needed.
=AVERAGEIF(B1:B10,">1000") // Averages only values greater than 1000.
Average only the values in B1:B10 that are greater than 1000. Formula: =AVERAGEIF(B1:B10,">1000").
The wildcard makes the match flexible, so Excel includes any entry that contains the word North.
=AVERAGEIF(A1:A10,"*North*",B1:B10) // Averages all matching North rows.
Average sales for entries in A1:A10 that contain the word "North". Formula: =AVERAGEIF(A1:A10,"*North*",B1:B10).
This is handy for reusable reports because the formula changes when the value in the criteria cell changes.
=AVERAGEIF(A1:A10,C1,B1:B10) // Uses the rule stored in C1.
Average expenses for the category stored in cell C1. Formula: =AVERAGEIF(A1:A10,C1,B1:B10).
range.* matches many characters and ? matches one.#DIV/0!.AVERAGEIFS when one condition is not enough.Tell your friends about this post