AVERAGEIFS in Excel: Averages With Several Conditions
By ExcelReady TeamUpdated 6 min read
The short answer
AVERAGEIFS averages the numbers in one range for the rows that meet every condition you give it. Write =AVERAGEIFS(average_range, criteria_range1, criteria1, ...), for example =AVERAGEIFS(C2:C8,A2:A8,"North",B2:B8,"Swift") for the average delivery days of Swift orders in the North. If no row matches, it returns #DIV/0!.
Key takeaways
- The average range comes first, then pairs of a criteria range and a criteria.
- A row is included only when it meets every condition (AND logic).
- AVERAGEIFS returns #DIV/0! when no row matches; wrap it in IFERROR to show a message.
- Blank cells and text in the average range are ignored, but zeros are included.
- AVERAGEIF puts the average range last; AVERAGEIFS puts it first.
On this page+
- What does AVERAGEIFS do?
- How to use AVERAGEIFS step by step
- AVERAGEIFS examples with text, numbers and dates
- AVERAGEIF vs AVERAGEIFS
- How to fix #DIV/0! in AVERAGEIFS
- How blanks, text and zeros are treated
- Related functions: MAXIFS, MINIFS and more
- How to build an average table by region and courier
- Practise it
AVERAGEIFS in Excel works out an average using only the rows that meet several conditions at once, such as "orders in the North and sent by Swift". It is the averaging partner of SUMIFS and COUNTIFS, with the same argument pattern. This guide covers the syntax, examples with text, numbers and dates, and the #DIV/0! error you'll see when nothing matches.
What does AVERAGEIFS do?#
AVERAGEIFS finds the average (the arithmetic mean) of the numbers in one range, counting only the rows where every condition is TRUE. Its syntax is:
=AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)| Part | What it means | Example |
|---|---|---|
| average_range | The numbers to average | C2:C8 |
| criteria_range1 | The first column to check | A2:A8 |
| criteria1 | What that column must match | "North" |
| criteria_range2, criteria2 | More pairs (optional) | B2:B8,"Swift" |
AVERAGEIFS works in Excel 2007 and every later version, including Microsoft 365 and Excel for the web. You can add up to 127 range and criteria pairs. The AVERAGEIFS function guide summarises the arguments.
Every example uses this delivery log in A1:C8:
| A | B | C | |
|---|---|---|---|
| 1 | Region | Courier | Days |
| 2 | North | Swift | 2 |
| 3 | South | Swift | 4 |
| 4 | North | Parcel | 5 |
| 5 | North | Swift | 3 |
| 6 | South | Parcel | 6 |
| 7 | East | Swift | 3 |
| 8 | North | Parcel | 7 |
How to use AVERAGEIFS step by step#
To find the average delivery time for Swift orders in the North:
- Click an empty cell, such as F2.
- Type
=AVERAGEIFS(C2:C8,to set the numbers to average. - Type
A2:A8,"North",for the first condition. - Type
B2:B8,"Swift")for the second condition. - Press Enter.
=AVERAGEIFS(C2:C8,A2:A8,"North",B2:B8,"Swift")The result is 2.5. Only rows 2 and 5 are North and Swift, with 2 and 3 days, and (2 + 3) / 2 = 2.5. All the ranges must be the same size, or AVERAGEIFS returns #VALUE!.
AVERAGEIFS examples with text, numbers and dates#
The criteria follow the same rules as COUNTIFS and SUMIFS. Text and operators go in double quotes; numbers and cell references don't. Here are more questions on the delivery log:
| Question | Formula | Result |
|---|---|---|
| Average days, North only | =AVERAGEIFS(C2:C8,A2:A8,"North") | 4.25 |
| Average days, Swift only | =AVERAGEIFS(C2:C8,B2:B8,"Swift") | 3 |
| North orders taking 3+ days | =AVERAGEIFS(C2:C8,A2:A8,"North",C2:C8,">=3") | 5 |
| Not North, Parcel | =AVERAGEIFS(C2:C8,A2:A8,"<>North",B2:B8,"Parcel") | 6 |
| Days from 3 to 6 | =AVERAGEIFS(C2:C8,C2:C8,">=3",C2:C8,"<=6") | 4.2 |
Notice that a criteria range can be the same as the average range, as in the last two number examples. "Days from 3 to 6" averages 4, 5, 3, 6 and 3, which is 21 / 5 = 4.2.
For dates, join the operator to DATE with &. If column D held order dates, =AVERAGEIFS(C2:C8,D2:D8,">="&DATE(2024,7,1)) would average the days for orders from 1 July 2024 onwards. To use a value from a cell, join it the same way: ">="&H1, never ">=H1".
AVERAGEIF vs AVERAGEIFS#
AVERAGEIF handles one condition; AVERAGEIFS handles one or more. The big trap is the argument order:
=AVERAGEIF(A2:A8,"North",C2:C8)
=AVERAGEIFS(C2:C8,A2:A8,"North")Both return 4.25. AVERAGEIF puts the average range last, and AVERAGEIFS puts it first. Many people use AVERAGEIFS for everything so they only remember one order. The guide to AVERAGEIF covers the single-condition version, and the comparison of AVERAGEIF vs AVERAGEIFS goes deeper.
How to fix #DIV/0! in AVERAGEIFS#
AVERAGEIFS returns #DIV/0! when no row meets every condition, because an average of nothing means dividing by zero. For example, =AVERAGEIFS(C2:C8,A2:A8,"West") has no West rows to average.
If an empty result is expected, wrap the formula in IFERROR to show a message instead:
=IFERROR(AVERAGEIFS(C2:C8,A2:A8,"West"),"No data")If you expected matches, don't hide the error. Check the spelling of the criteria, look for extra spaces in the data, and make sure the numbers in the average range are real numbers, not text.
How blanks, text and zeros are treated#
AVERAGEIFS ignores blank cells and text in the average range, so a missing value doesn't drag the average down. Zeros are different: a 0 is a real number, so it is included. If a 0 means "no data" in your sheet, add a condition that leaves zeros out:
=AVERAGEIFS(C2:C8,A2:A8,"North",C2:C8,"<>0")The guide to averaging without zeros covers this case in more detail.
One more check: if the whole average range is blank or text, there are no numbers to average, so you get #DIV/0! even when the conditions match.
Related functions: MAXIFS, MINIFS and more#
AVERAGEIFS belongs to a family of functions with the same pattern:
- SUMIFS and COUNTIFS add and count with several conditions.
- MAXIFS and MINIFS find the largest and smallest value with several conditions. They need Excel 2019 or later. See MAXIFS and MINIFS.
Once you know one, you know them all; only the function name and the first range change. These are core tools for reporting roles, as the guide to Excel skills for operations managers explains.
How to build an average table by region and courier#
AVERAGEIFS is ideal for a small grid with one condition down the side and another across the top. Put the regions North, South and East in E2:E4, and the couriers Swift and Parcel in F1:G1. In F2, type:
=IFERROR(AVERAGEIFS($C$2:$C$8,$A$2:$A$8,$E2,$B$2:$B$8,F$1),"-")Fill it right to G2, then down to row 4. The result:
| Swift | Parcel | |
|---|---|---|
| North | 2.5 | 6 |
| South | 4 | 6 |
| East | 3 | - |
The $ signs do the work. $E2 keeps the column fixed so every cell reads the region from column E, and F$1 keeps the row fixed so every cell reads the courier from row 1. East has no Parcel orders, so IFERROR shows a dash instead of #DIV/0!.
Practise it#
AVERAGEIFS is quick to learn once the argument order sticks. Practise AVERAGEIF, MAXIFS and related functions in a live spreadsheet: you type each formula and the lesson checks it instantly. Or work out the North and Swift average in the exercise on this page first.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
What is the average delivery time for Swift orders in the North region? In F2, use AVERAGEIFS on the Days column (C2:C8).
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Days | ||||||
| 2 | North + Swift | ||||||
| 3 | |||||||
| 4 | |||||||
| 5 | |||||||
| 6 | |||||||
| 7 | |||||||
| 8 | |||||||
| 9 | |||||||
| 10 | |||||||
| 11 |
Tip: Start with the Days range, then A2:A8 with "North", then B2:B8 with "Swift".
Practise this in a lesson
Frequently asked questions
What is the AVERAGEIFS formula in Excel?
The formula is =AVERAGEIFS(average_range, criteria_range1, criteria1, criteria_range2, criteria2, ...). It averages the cells in the first range for the rows that meet all the conditions.
What is the difference between AVERAGEIF and AVERAGEIFS?
AVERAGEIF takes one condition and puts the average range last. AVERAGEIFS takes one or more conditions and puts the average range first. AVERAGEIFS can do everything AVERAGEIF does.
Why does AVERAGEIFS return #DIV/0!?
No row meets all the conditions, so there is nothing to average. Check the spelling of the criteria, or wrap the formula in IFERROR to show a message such as No data.
How do I average between two numbers with AVERAGEIFS?
Use the same range twice: =AVERAGEIFS(C2:C8,C2:C8,">=3",C2:C8,"<=6"). It averages the values from 3 to 6, including both limits.
Can AVERAGEIFS ignore zeros?
Yes. Add a condition on the average range itself: =AVERAGEIFS(C2:C8,A2:A8,"North",C2:C8,"<>0"). The "<>0" condition leaves out every zero.