AVERAGEIF calculates the mean of values that meet a condition — the conditional version of AVERAGE. Essential for regional, category, and segment analysis.
AVERAGEIF calculates the arithmetic mean of the values in a range where a corresponding range matches a condition you set. It is the conditional version of AVERAGE — just as SUMIF is the conditional version of SUM, and COUNTIF is the conditional version of COUNT.
Use AVERAGEIF when you need the typical value for a specific subset of your data: average sales for one region, average score for one category, average transaction value above a threshold, or average time for one team.
=AVERAGEIF(range, criteria, [average_range])| Argument | Description |
|---|---|
| range required | The column to check the condition against. |
| criteria required | The condition a row must meet to be included. Text in quotes, numbers and cell references without. |
| average_range optional | The column with the numbers to average. If omitted, AVERAGEIF averages the range column itself. |
=AVERAGEIF(A2:A100, "North", C2:C100)Checks column A for "North" and averages the corresponding values in column C.
=AVERAGEIF(B2:B100, ">1000")Averages only values above 1,000. When range and average_range are the same, you can omit average_range.
=AVERAGEIF(B2:B100, "<>0")Zeros often represent missing data rather than genuine zero values. Excluding them gives a more accurate mean.
=AVERAGEIF(A2:A100, E1, C2:C100)E1 contains the region name. Change E1 and the average updates instantly — the foundation of dynamic dashboards.
=AVERAGEIF(A2:A100, "*coffee*", C2:C100)The * wildcard matches any text before or after "coffee" — Coffee Latte, Iced Coffee, and Coffee all match.
=IF(AVERAGEIF(A:A,"Team A",B:B) > AVERAGE(B:B), "Above avg","Below avg")Combines AVERAGEIF with AVERAGE to benchmark a group against the whole.
Use AVERAGEIFS when you need to filter by more than one criterion. Important: the average range comes FIRST in AVERAGEIFS, unlike AVERAGEIF where it comes last.
=AVERAGEIFS(avg_range, range1, criteria1, range2, criteria2, ...)=AVERAGEIFS(C2:C100, A2:A100, "Coffee", B2:B100, "North")If no rows meet your condition, there is nothing to average — AVERAGEIF returns #DIV/0!. Wrap with IFERROR: =IFERROR(AVERAGEIF(...),"No data").
A2:A100 and C2:C50 in the same formula will give wrong results. Always use identical row counts for both ranges.
ExcelPro has AVERAGEIF and AVERAGEIFS exercises across all tracks. Free to start.
Try exercises →