AVERAGEIF Function

Excel Functions › Statistical

Excel 2007+ Statistical

The Excel AVERAGEIF function averages only the cells that meet a single condition — for example, the mean sale in just the East region, or the average score above a cutoff.


Quick answer:
=AVERAGEIF(A2:A20,"East",B2:B20) mean of B where A = "East"

Syntax

=AVERAGEIF(range, criteria, [average_range])
ArgumentDescription
rangeRequiredThe cells to test against the criteria.
criteriaRequiredThe condition, e.g. "East", ">100", "<>0", or a cell reference.
average_rangeOptionalThe cells to average. If omitted, range itself is averaged.

How to use it

AVERAGEIF tests every cell in range against one criteria and averages the matching rows. If you supply a separate average_range, the test happens in the first range but the numbers are pulled from the second.

=AVERAGEIF(A2:A20,"East",B2:B20) // avg sales for East
=AVERAGEIF(B2:B20,">100") // avg of values over 100

Criteria support comparison operators (>, <, >=, <>) and wildcards (* for any text, ? for a single character). For a region column where the East rows total 1,240 across 4 entries, =AVERAGEIF(A2:A20,"East",B2:B20) returns 310.

Need more than one condition? Use AVERAGEIFS, which lets you stack multiple criteria pairs (region and month and > target).

Try it: interactive demo

Live demo

Pick a AVERAGEIF example to see the formula and its result.

Result:

Practice workbook

📊
Download the free AVERAGEIF practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

What if I omit the average_range argument?
Then AVERAGEIF averages the same cells it tests — the range argument itself. Supply average_range only when the values to average live in a different column.
Can I use comparison operators or wildcards?
Yes. Use ">100", "<>0", or text with wildcards like "North*". Wrap operators in quotes and join cell references with &, e.g. ">"&C1.
Why do I get a #DIV/0! error?
No cells matched the criteria, so there was nothing to average. Check the spelling of text criteria and confirm the range actually contains matching values.
How is AVERAGEIF different from AVERAGEIFS?
AVERAGEIF allows exactly one condition; AVERAGEIFS allows several at once and puts the average range first. For a single test either works, but the argument order differs.

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: AVERAGEIFS · AVERAGE · SUMIF · COUNTIF · AVERAGEA