Statistical function

AVERAGEIFS function

Averages the cells that meet several conditions at once, for example sales of one product in one region, or invoices between two dates.

Available in Excel 2007 and later, Excel for the web, Excel for Mac

Excel 2007 and laterWorks in Google Sheets

Syntax

AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
ArgumentWhat it means
average_rangeRequiredThe cells that contain the numbers to average.
criteria_range1RequiredThe first range to test. Must be the same size as average_range.
criteria1RequiredThe condition for criteria_range1, written like a COUNTIF criterion: "North", ">=500", ">="&E1, "Lap*".
criteria_range2, criteria2, ...OptionalUp to 126 additional range/condition pairs. A row is included only if it passes every test.

Returns: The mean of the rows that satisfy all conditions, or #DIV/0! if none do.

How AVERAGEIFS works

AVERAGEIFS is AVERAGEIF with as many conditions as you like. Every condition is a pair: a range to test and the test itself. A row only makes it into the average when it passes all of them, so the conditions behave like AND. Typical uses are "average sale of chairs in the North", "average invoice in March" or "average salary of staff aged 30 to 39".

Notice the argument order: the range you average comes first, which is the opposite of AVERAGEIF. All the ranges must have the same number of rows and columns, otherwise Excel returns #VALUE!. You can test the same column twice to build a range (">=30" and "<40"), which is the standard way to average between two dates or two numbers.

For OR logic (North or South), add two AVERAGEIFS results weighted by their counts, or in Microsoft 365 use =AVERAGE(FILTER(C2:C7, (A2:A7="North")+(A2:A7="South"))). Blank and text cells in average_range are ignored.

Examples

1Average chair sale in the North

E2fx=AVERAGEIFS(C2:C7, A2:A7, "North", B2:B7, "Chairs")
ABCDE
1RegionProductSale
2NorthChairs420460
3SouthChairs380
4NorthDesks910
5NorthChairs460
6SouthDesks870
7NorthChairs500

Result: 460

Three rows are both North and Chairs: 420, 460 and 500. Their average is 1,380 / 3 = 460. The North desk sale and the South chair sale are left out because they fail one of the two tests.

2Average invoice in March 2026

D2fx=AVERAGEIFS(B2:B6, A2:A6, ">="&DATE(2026,3,1), A2:A6, "<"&DATE(2026,4,1))
ABCD
1Invoice dateAmount
22026-02-26310415.00
32026-03-02450
42026-03-11280
52026-03-25515
62026-04-01600

Result: 415.00

The date column is tested twice: on or after 1 March and before 1 April. Three invoices qualify (450, 280 and 515), so the average is 1,245 / 3 = 415.00. Using "<" the first day of the next month is safer than "<=31 March" because it also catches times later on 31 March.

3Average salary for staff aged 30–39

E2fx=AVERAGEIFS(C2:C7, B2:B7, ">=30", B2:B7, "<40")
ABCDE
1NameAgeSalary
2Aiko273850047,366.67
3Bruno3446200
4Cara3951800
5Dev4155000
6Elif3144100
7Femi4560300

Result: 47,366.67

Bruno (34), Cara (39) and Elif (31) fall in the band. Their salaries total 142,100, giving an average of 47,366.67 when shown with 2 decimals.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 16 KB

Common errors and how to fix them

ErrorWhy it happensFix
#DIV/0!No row passes all the conditions.Test each condition alone with COUNTIFS to find which one removes every row, then wrap the formula in IFERROR if an empty result is normal.
#VALUE!The criteria ranges are not the same size as average_range.Make every range cover exactly the same rows, e.g. all from row 2 to row 7.

Tips

  • Put conditions in cells (say F1 for the region and F2 for the product) so a reader can change them without editing the formula: =AVERAGEIFS(C2:C7, A2:A7, F1, B2:B7, F2).
  • An empty criteria cell is read as "equal to empty", which usually matches nothing. Use "*" or a wrapper with IF when a filter should be optional.
  • AVERAGEIFS works on closed-workbook links poorly: the source file must be open or you get #VALUE!.

Questions

What is the difference between AVERAGEIF and AVERAGEIFS?

AVERAGEIF takes one condition and puts the average range last; AVERAGEIFS takes up to 127 conditions and puts the average range first. AVERAGEIFS with one condition works fine, so many people only use AVERAGEIFS.

How do I average between two dates?

Test the date column twice: =AVERAGEIFS(B2:B6, A2:A6, ">="&E1, A2:A6, "<="&E2), where E1 and E2 hold the start and end dates.

Can AVERAGEIFS use OR conditions?

Not directly; all conditions are combined with AND. Use FILTER with + between the tests in Microsoft 365, or combine SUMIFS and COUNTIFS with array constants: =SUM(SUMIFS(C:C,A:A,{"North","South"}))/SUM(COUNTIFS(A:A,{"North","South"})).

Google Sheets

AVERAGEIFS also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

AVERAGEIFS in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
DanishMIDDEL.HVISER
DutchGEMIDDELDEN.ALS
FinnishKESKIARVO.JOS.JOUKKO
FrenchMOYENNE.SI.ENS
GermanMITTELWERTWENNS
HungarianÁTLAGHATÖBB
ItalianMEDIA.PIÙ.SE
Norwegian (Bokmål)GJENNOMSNITT.HVIS.SETT
PolishŚREDNIA.WARUNKÓW
Portuguese (Brazil)MÉDIASES
Portuguese (Portugal)MÉDIA.SE.S
RussianСРЗНАЧЕСЛИМН
SpanishPROMEDIO.SI.CONJUNTO
SwedishMEDEL.OMF
TurkishÇOKEĞERORTALAMA

Recipes that use AVERAGEIFS