Example 1
Average for one region
C11 =AVERAGEIF(A2:A9,"East",C2:C9)
Result: 1,200
Three East orders (1,200, 1,400 and 1,000) add up to 3,600. Divided by 3 gives 1,200.
C11 =AVERAGEIF(A2:A9,"East",C2:C9) returns 1,200
Averages the numbers in a range that meet one condition, such as the average order value for one region.
Syntax
=AVERAGEIF(, , )
Excel 2007 and later, including Excel for Microsoft 365 and Excel for the web.
Try it
Edit the formula in C11 or change the inputs. The sheet recalculates as you type.
C11 =AVERAGEIF(A2:A9,"East",C2:C9) returns 1,200
AVERAGEIF works out the average of only those numbers that pass a test. Use it for "average order value for the East region", "average score above 60", or "average of everything except returns".
AVERAGEIF checks each cell in range against criteria. For every cell that passes, it takes the number in the same position of average_range and adds it to the average. If you leave out average_range, AVERAGEIF averages the cells in range itself, which suits conditions on the numbers, such as =AVERAGEIF(C2:C9,">=1000").
The criteria can be:
"East" or 50, which must match the whole cell. Matching ignores upper and lower case.">100", "<=20" or "<>East". The operator and number go together inside one set of quotes."N*" for anything starting with N.E2. This is the best option when the condition changes, because you can type a new region into E2 and the average follows. To combine an operator with a cell, join them: ">"&E2.Cells in average_range that are blank, or hold text, are ignored. If a cell in range matches but the matching cell in average_range is empty, that row is left out, not counted as zero. If no cell matches at all, AVERAGEIF returns #DIV/0!. Wrap it in IFERROR when "no matching rows" is a normal outcome:
=IFERROR(AVERAGEIF(A2:A9,"South",C2:C9),"No orders")
AVERAGEIF takes a single condition. For two or more, such as East region and orders over 1000, use AVERAGEIFS. Note that the argument order differs: in AVERAGEIF the average_range comes last, and in AVERAGEIFS it comes first.
Without a condition, use AVERAGE. To average visible rows after filtering, use SUBTOTAL or AGGREGATE. In Microsoft 365 you can also combine FILTER with AVERAGE, which is handy when the condition is complicated: =AVERAGE(FILTER(C2:C9,A2:A9="East")).
A2:A9. If you leave out average_range, these are also the cells that get averaged.">=1000", "<>East" or "W*". Text and operators go in quotes. * matches any run of characters and ? matches one character.C2:C9. It is matched to range by position, starting from its top-left cell, so give it the same shape as range.Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
C11 =AVERAGEIF(A2:A9,"East",C2:C9)
Result: 1,200
Three East orders (1,200, 1,400 and 1,000) add up to 3,600. Divided by 3 gives 1,200.
C11 =AVERAGEIF(A2:A9,"East",C2:C9) returns 1,200
Example 2
C11 =AVERAGEIF(C2:C9,">=1000")
Result: 1,190
With no average_range, AVERAGEIF averages the cells it tests. Five orders are 1,000 or more: 1,200, 1,400, 1,100, 1,000 and 1,250, which average 1,190.
C11 =AVERAGEIF(C2:C9,">=1000") returns 1,190
Example 3
C11 =AVERAGEIF(A2:A9,"W*",C2:C9)
Result: 1,100
"W*" matches West. Its orders (950, 1,100 and 1,250) average 1,100.
C11 =AVERAGEIF(A2:A9,"W*",C2:C9) returns 1,100
Example 4
C11 =IFERROR(AVERAGEIF(A2:A9,"South",C2:C9),"No orders")
Result: No orders
There is no South row, so AVERAGEIF alone returns #DIV/0!. IFERROR turns that into a readable message.
C11 =IFERROR(AVERAGEIF(A2:A9,"South",C2:C9),"No orders") returns No orders
Solve it in the sheet. Every answer is checked, with hints if you need them.
Task 1 of 2
In E2, return the average order value for the channel named in D2.
Answer in E2.
#DIV/0! means no cell met the condition. Check the spelling of the criteria and look for stray spaces in the data. Use IFERROR if "no matches" is expected."E2", searches for the literal text E2. Write E2 without quotes, or ">"&E2 to combine it with an operator.#VALUE!.">100" compares numbers only. Numbers stored as text in range are not matched by a numeric comparison.AVERAGEIF takes one condition and puts average_range last. AVERAGEIFS takes one or more conditions and puts average_range first. AVERAGEIFS also works with a single condition.
Use the not-equal operator inside quotes: `=AVERAGEIF(A2:A9,"<>East",C2:C9)` averages every row except East.
Yes. `=AVERAGEIF(A2:A9,E2,C2:C9)` uses whatever is in E2. To compare with an operator, join it to the cell: `=AVERAGEIF(C2:C9,">"&E2)`.
No cell in the range met the condition, so there was nothing to average. Check for typos and extra spaces, or wrap the formula in IFERROR.
No. `"east"` matches `East` and `EAST`.
Tracks take you from the basics to modelling, one graded exercise at a time.