FxFormula Drills

AVERAGEIFS examples

AVERAGEIFS averages the numbers that pass every condition. The range to average is the first argument, then pairs of criteria range and criterion, the same order as SUMIFS. AVERAGE ignores conditions and also ignores text. AVERAGEIF takes one condition and puts the test range first. If no row qualifies, AVERAGEIF and AVERAGEIFS return #DIV/0!, not zero.

Syntax

AVERAGE

AVERAGE(range)

Arithmetic mean of the numbers in the range. Text and blanks are skipped. A zero that is actually stored in a cell is included.

AVERAGEIF

AVERAGEIF(range, criteria, [average_range])

One condition. range is tested. average_range is averaged and must line up with range. If you omit average_range, the cells in range that match are averaged.

AVERAGEIFS

AVERAGEIFS(average_range, criteria_range1, criteria1, ...)

average_range comes first. Every later pair must be true. Same shape as SUMIFS, but the result is a mean, not a total.

Comparison

QuestionAVERAGEAVERAGEIFAVERAGEIFS
ConditionsNoneOneOne or more, as AND
Argument orderThe numbersTest range, criterion, then the numbersNumbers first, then pairs
Text in the number rangeIgnoredIgnored in the average rangeIgnored in the average range
Nothing matches#DIV/0! if the range has no numbers#DIV/0!#DIV/0!
VersionsAll current Excel and Google SheetsAll current Excel and Google SheetsExcel 2007 and later, and Google Sheets

Worked examples

Average East order, then average East Pen

East amounts are 10, 30, and 20. Their mean is 20. East Pens are 10 and 20. Their mean is 15. The West Pen, 40, is outside both of those filters.

Amounts 10, 40, 30, and 20.
RowABC
1RegionProductAmount
2EastPen10
3WestPen40
4EastBook30
5EastPen20
  • =AVERAGE(C2:C5) → 25
  • =AVERAGEIF(A2:A5,"East",C2:C5) → 20
  • =AVERAGEIFS(C2:C5,A2:A5,"East",B2:B5,"Pen") → 15

The four amounts average to 25. AVERAGEIF keeps East only: (10+30+20)/3 is 20. AVERAGEIFS also requires Pen: (10+20)/2 is 15. The average range is C2:C5 in the AVERAGEIFS call, in front of the pairs.

A condition that matches nothing

No row has the region South. Averaging an empty set is division by zero, not a quiet zero.

Regions are only East and West.
RowABC
1RegionProductAmount
2EastPen10
3WestPen40
4EastBook30
5EastPen20
  • =AVERAGEIFS(C2:C5,A2:A5,"South") → #DIV/0!

SUMIFS would return 0 for South. AVERAGEIFS returns #DIV/0! because the mean of no numbers is undefined. Wrap it in IFERROR only after you have decided that a missing group should display as a blank or as a label. While you are checking the criterion, the error is useful.

When to use which

Use AVERAGE for a whole column of scores or amounts

No category, no threshold. The free average drill is this function. Remember that a typed 0 pulls the mean down and a blank does not.

Use AVERAGEIF for one group

Average revenue in one region, or average score above a cutoff if the range you test is the range you average. The premium region drill is one condition.

Use AVERAGEIFS for a slice defined by several columns

Average East Pen, or average a channel inside a region. The argument order matches SUMIFS, so learn that order once.

Common mistakes

Reading #DIV/0! as a broken range

If the ranges are the right length and the spelling is the only question, #DIV/0! means zero rows survived. SUMIFS of the same pairs returning 0 confirms it.

Including a header in the average range

A header that is text is ignored, so the mean may look fine. A header that is a number, or a note someone typed as 0, changes the mean. Start on the first data row.

Using the SUMIF argument order

AVERAGEIFS(A2:A5, "East", C2:C5) is not 'average column C where column A is East'. The numbers come first.

Averaging a condition you meant to sum

20 is the typical East order, not the East total. The East total is 60, from SUMIF. Check the function name when the result looks too small.

Versions and compatibility

AVERAGE and AVERAGEIF are in current Excel, older Excel, and Google Sheets. AVERAGEIFS is in Excel 2007 and later and in Google Sheets.

The #DIV/0! result for no matching rows is the same in Google Sheets.

IFERROR around an average hides #DIV/0! and also hides a real error in the range. Prefer to fix the criterion first.

Practice on Formula Drills

Free drills are open with no account. Premium drills show the problem to everyone and grade the sheet for subscribers.

Free exercises

Premium exercises

Function pages

FAQ

Does AVERAGEIFS ignore blank amount cells?

Blank cells in the average range are not numbers, so they do not enter the mean and they do not add a zero. A row that fails a criterion is excluded entirely.

Can I average East or West together?

Not with one extra pair. Two groups are either one AVERAGEIF on a helper column that marks both regions, or a SUMPRODUCT mean you build yourself. Adding two averages is not the average of the combined rows unless the groups are the same size.

Why does my average show a long decimal?

The mean of 10, 30, and 15 is not a short decimal. This page uses 10, 30, and 20 so the East mean is 20 exactly. ROUND around the average is a display decision. ROUND changes the stored value. A number format changes only how it looks.

Is the order of pairs important?

No. East then Pen is the same filter as Pen then East. The average range still has to be first.