=AVERAGEIF(criteria_range, criterion, [average_range])One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
| Parameter | Required | Description |
|---|---|---|
| criteria_range | Yes | The range to test against the criterion. |
| criterion | Yes | The condition to apply, such as "West", ">100", or a cell reference. |
| average_range | No | The cells to average. If omitted, the cells in criteria_range are averaged. |
AVERAGEIF returns the mean of the values that meet one condition. It works like SUMIF, except that it divides the matching total by the number of matches. Use it when you want an answer such as "average order value for the West region" or "average score above 50".
AVERAGEIF checks every cell in criteria_range against the criterion. For each match, the cell in the same position in average_range is included in the average. If you leave out average_range, AVERAGEIF averages the matching cells in criteria_range itself. Text and blank cells in the averaged range are ignored, just as with AVERAGE.
=AVERAGEIF(A2:A200, "West", C2:C200)Averages column C for every row where column A is "West".
=AVERAGEIF(B2:B100, ">50")Averages only the numbers in B2:B100 that are greater than 50.
=AVERAGEIF(B2:B100, "<>0")Averages every non-zero number, a common way to ignore placeholder zeros.
=AVERAGEIF(A2:A200, F1, C2:C200)Lets you change the category in F1 and see the result update.
| Operator | Meaning | Example |
|---|---|---|
> | Greater than | ">100" |
< | Less than | "<10" |
>= | Greater than or equal to | ">=0" |
<= | Less than or equal to | "<=5" |
<> | Not equal to | "<>Closed" |
Combine an operator with a cell value using &:
=AVERAGEIF(B2:B100, ">="&E1)For text criteria, * matches any run of characters and ? matches exactly one:
=AVERAGEIF(A2:A200, "*Pro*", C2:C200)Averages column C for any product name that contains "Pro". To match a literal asterisk or question mark, put a tilde in front (~*).
=AVERAGEIF(A2:A365, ">="&DATE(2026,7,1), B2:B365)Averages values for dates on or after 1 July 2026. Build date criteria with DATE rather than typing a date string, to avoid locale problems.
=IFERROR(AVERAGEIF(...), "").>50 must be written as ">50"."west" matches "West".A sales director wants to compare regions. With regions in column A and deal values in column C, =AVERAGEIF(A2:A500, "West", C2:C500) returns the average deal size in the West, and changing the criterion to a cell reference lets one formula serve every region.
Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.
Browse our complete library of Google Sheets formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.