formulastreak

Conditional totals function

AVERAGEIFS function in Google Sheets and Excel

AVERAGEIFS averages the numbers in one range for the rows that meet one or more conditions.

Checked against Microsoft's and Google's documentation on · Example calculated on a live sheet

Syntax

AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)

Arguments in [brackets] are optional. Google Sheets writes it AVERAGEIFS(average_range, criteria_range1, criterion1, [criteria_range2, criterion2, ...]).

Example

=AVERAGEIFS(C2:C9,B2:B9,"East") reads: Average the July figures in C2:C9 for the rows where Region (B2:B9) is "East".

Q3 sales team · edit I1 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultI1 = $12,650
ABCDEFGHI
1RepRegionJulAugSepTargetEast Jul avg$12,650
2Amara OseiNorth$12,400$13,100$11,800$36,000
3Ben FischerSouth$9,800$10,250$12,100$30,000
4Lina ChenEast$15,200$14,800$16,900$45,000
5Diego AlvarezWest$8,700$9,100$8,400$28,000
6Eva NovakNorth$11,200$12,600$13,900$36,000
7Farid HaddadSouth$13,300$12,900$14,100$39,000
8Grace KimEast$10,100$9,600$10,800$33,000
9Hugo MartinWest$14,500$15,800$15,100$42,000

I1 shows $12,650: the average of Lina's $15,200 and Grace's $10,100 in July.

How the spreadsheet calculates it

Works out the average of C2:C9 on the rows where B2:B9 is equal to "East".

  1. 1. AVERAGEIFS: Works out the average of C2:C9 on the rows where B2:B9 is equal to "East".
    • average_range = `C2:C9`: the numbers to average
    • range1 = `B2:B9`: the column to check
    • criteria1 = `"East"`: what it must match

More AVERAGEIFS examples

  • =AVERAGEIFS(C2:C9,C2:C9,"<>0")The July average, leaving out zeros.
  • =AVERAGEIFS(I2:I13,E2:E13,"Plants",H2:H13,"Shipped")The average total of shipped plant orders.
  • =IFERROR(AVERAGEIFS(C2:C9,B2:B9,I2),"No reps")The average for the region in I2, with a message when it has no reps.
  • =AVERAGEIFS(I2:I13,B2:B13,">="&DATE(2026,3,1),B2:B13,"<"&DATE(2026,3,8))The average order total in the first week of March.

Paste any of these into the formula explainer to see it step by step.

Tips

  • Check a surprising average with COUNTIFS on the same conditions: it tells you how many rows were averaged.
  • Lock the ranges with $ and point the criteria at cells to build a summary table.
  • Use IFERROR around it in summary tables where some groups may be empty.

What AVERAGEIFS is used for

Average sale per region or product, average order value for one channel, average response time for high-priority tickets, and average score per class, wherever a group's mean matters more than its total.

Arguments

ArgumentRequiredWhat it is
average_rangeYesThe numbers to average, such as July C2:C9. In AVERAGEIFS it always comes first.
criteria_range1YesThe first range to test, such as Region B2:B9.Watch out: It must be the same size and shape as average_range.
criteria1YesIts condition: "East", ">10000", a cell, or a wildcard.
criteria_range2, criteria2, ...NoMore pairs, up to 127 in all; a row is averaged only when all of them match.

Common mistakes

  • Putting the average range last, like SUMIF's sum range.

  • No row matching the conditions: Microsoft documents #DIV/0! for AVERAGEIFS then. Wrap it in IFERROR with a message such as "No data".

  • Averaging the averages: the mean of each region's AVERAGEIFS isn't the team average when regions have different numbers of reps.

In Google Sheets

Google Sheets' AVERAGEIFS takes the same arguments in the same order, average range first.

Errors you may see with AVERAGEIFS

  • #DIV/0!: No row meets all the conditions, so there's nothing to average.
  • #VALUE!: average_range and a criteria range have different sizes.

Questions

Why does AVERAGEIFS return #DIV/0!?

No row matched every condition: often a typo or a stray space in the criteria, or a date condition that's out of range. Check each condition with COUNTIFS using the same pairs; 0 means nothing matched.

How do I average between two dates?

Test the date column twice: =AVERAGEIFS(I2:I13,B2:B13,">="&DATE(2026,3,1),B2:B13,"<"&DATE(2026,3,8)) averages the first week of March.

How do I average while leaving out zeros?

Use the average range as its own criteria range: =AVERAGEIFS(C2:C9,C2:C9,"<>0").

What's the difference between AVERAGEIF and AVERAGEIFS?

AVERAGEIF takes one condition with the average range last (and optional); AVERAGEIFS takes one or more with the average range first, the same order as SUMIFS.

Sources

Official documentation the facts on this page were checked against.

Practise AVERAGEIFS on a live sheet

Lesson 20, COUNTIF, AVERAGEIFS and MAXIFS (Unit 5, Conditional totals), has 6 graded exercises, checked instantly, with steps and hints when you're stuck. Pro