AVERAGEIFS returns the average of numbers in a range that meet one or more conditions. It lets you average only the rows that match all your criteria, such as a region and a product.
=AVERAGEIFS(average_range, criteria_range1, criteria1, …)What does AVERAGEIFS do?
AVERAGEIFS is a statistical function that calculates the average of values in a range only when those values meet every condition you specify. You provide one range to average and then pairs of criteria ranges and criteria. Excel checks each row against all the conditions and averages only the numbers where every condition is true.
This matters because real data rarely has just one filter. You often need the average sales for a specific region and product, or the average score for a class and gender. AVERAGEIFS handles that in one formula, so you avoid sorting, filtering, or building helper columns. It updates automatically when your data changes.
For example, a sales manager might want the average order value for the North region in Q1. With AVERAGEIFS, they point to the order values, the region column, the quarter column, and the two criteria. The result is a single number they can drop into a report.
When to use AVERAGEIFS
- Average sales for a specific region and product category.
- Average test scores for a class and a particular grade level.
- Average delivery time for a carrier and a destination zone.
- Average employee salary for a department and job title.
- Average customer spend for a segment and a date range.
- Average inventory level for a warehouse and item type.
AVERAGEIFS syntax
=AVERAGEIFS(average_range, criteria_range1, criteria1, …)| Argument | Required? | What to enter |
|---|---|---|
average_range | Required | The range of numbers to average. Only cells that meet all criteria are included. Example: B2:B10. |
criteria_range1 | Required | The first range to test against criteria1. It must be the same size as average_range. Example: A2:A10. |
criteria1 | Required | The condition that criteria_range1 must meet. It can be a number, text, cell reference, or expression like ">100". Example: "North". |
criteria_range2 | Optional | An additional range to test. You can add up to 127 pairs. Example: C2:C10. |
criteria2 | Optional | The condition for criteria_range2. All criteria must be true for a row to be averaged. Example: ">=2024-01-01". |
What it returns: AVERAGEIFS returns a single number: the arithmetic mean of the cells in average_range that meet all criteria. If no cells meet the criteria, it returns #DIV/0!.
AVERAGEIFS examples
1 Average sales for one region
This example averages the Sales column only for rows where the Region is North. The formula checks each cell in A2:A8 against "North" and averages the matching values in B2:B8. The matching sales are 1200, 1500, and 1800, which average to 1500. The result appears in D2.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Region | Sales | |||
| 2 | North | 1200 | 1500 | ||
| 3 | South | 900 | |||
| 4 | North | 1500 | |||
| 5 | East | 1100 | |||
| 6 | North | 1800 | |||
| 7 | South | 1300 | |||
| 8 | East | 1000 | |||
| 9 |
2 Average sales for a region and product
Here you want the average sales for North region and Widget product. The formula averages B2:B9 only when A2:A9 equals "North" and C2:C9 equals "Widget". The only matching row is row 2 with 1200, so the average is 1200. The result is placed in E2.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Region | Sales | Product | |||
| 2 | North | 1200 | Widget | 1500 | ||
| 3 | South | 900 | Widget | |||
| 4 | North | 1500 | Gadget | |||
| 5 | East | 1100 | Widget | |||
| 6 | North | 1800 | Widget | |||
| 7 | South | 1300 | Gadget | |||
| 8 | East | 1000 | Gadget | |||
| 9 | North | 700 | Gadget | |||
| 10 |
3 Average sales above a threshold in a region
This example finds the average sales in the North region but only for sales greater than 1000. The formula uses two criteria: region equals "North" and sales greater than 1000. The North sales are 1200, 1500, and 1800, all above 1000, so the average is 1500. The result goes in D2.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Region | Sales | |||
| 2 | North | 1200 | 1500 | ||
| 3 | South | 900 | |||
| 4 | North | 1500 | |||
| 5 | East | 1100 | |||
| 6 | North | 1800 | |||
| 7 | South | 1300 | |||
| 8 | East | 1000 | |||
| 9 |
4 Average order value for a date range
You need the average order value for the North region between 2024-01-01 and 2024-01-31. The formula averages C2:C10 when A2:A10 is "North" and B2:B10 is on or after 2024-01-01 and on or before 2024-01-31. The matching orders are 1200, 1500, and 1800, averaging to 1500. The result is in E2.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Region | Date | OrderValue | |||
| 2 | North | 2024-01-05 | 1200 | 1500 | ||
| 3 | South | 2024-01-10 | 900 | |||
| 4 | North | 2024-01-15 | 1500 | |||
| 5 | East | 2024-01-20 | 1100 | |||
| 6 | North | 2024-01-25 | 1800 | |||
| 7 | South | 2024-02-01 | 1300 | |||
| 8 | East | 2024-02-05 | 1000 | |||
| 9 | North | 2024-02-10 | 700 | |||
| 10 | South | 2024-02-15 | 1600 | |||
| 11 |
5 Average salary by department and job title
This business example averages salaries for the Sales department and Manager title. The formula averages D2:D10 when B2:B10 is "Sales" and C2:C10 is "Manager". The matching salaries are 60000 and 65000, which average to 62500. The result is placed in F2.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Employee | Department | Title | Salary | |||
| 2 | Alice | Sales | Manager | 60000 | 62500 | ||
| 3 | Bob | Sales | Associate | 40000 | |||
| 4 | Carol | HR | Manager | 55000 | |||
| 5 | David | Sales | Manager | 65000 | |||
| 6 | Eve | IT | Associate | 50000 | |||
| 7 | Frank | HR | Associate | 45000 | |||
| 8 | Grace | IT | Manager | 70000 | |||
| 9 | Henry | Sales | Associate | 42000 | |||
| 10 | Ivy | HR | Manager | 58000 | |||
| 11 |
Common AVERAGEIFS errors and how to fix them
| Error | Why it happens | How to fix it |
|---|---|---|
| #DIV/0! | No cells meet all the criteria, so there is nothing to average. | Check your criteria for typos or overly strict conditions. Use IFERROR to display a friendly message, e.g. =IFERROR(AVERAGEIFS(...),"No matches"). |
| #VALUE! | A criteria range or the average range has a different size from the others. | Make sure every range in the formula covers the same number of rows and columns. |
| #NAME? | The function name is misspelled, or text criteria are not in quotation marks. | Type AVERAGEIFS exactly and wrap text criteria in double quotes, e.g. "North". |
| Wrong result | Criteria are entered without quotes or with the wrong operator, such as >1000 instead of ">1000". | Put operators and text inside quotes: ">1000", "<=2024-12-31", "North". |
Tips for using AVERAGEIFS
- Use cell references for criteria so you can change the condition without editing the formula, e.g.
=AVERAGEIFS(B2:B10,A2:A10,F1). - Remember that AVERAGEIFS uses AND logic: every criterion must be true for a row to be included.
- For date criteria, use the ISO format in quotes, such as
">=2024-01-01", or refer to a date cell. - Wildcards work in text criteria:
"N*"matches any text starting with N, and"?orth"matches a single character before "orth". - Keep all ranges the same size; otherwise Excel returns #VALUE!.
- Use IFERROR to handle cases where no rows match and you want a blank or a message instead of #DIV/0!.
Frequently asked questions
What is the difference between AVERAGEIF and AVERAGEIFS?
AVERAGEIF handles one condition. AVERAGEIFS handles one or more conditions and uses a different argument order: average_range comes first, then pairs of criteria ranges and criteria.
Can AVERAGEIFS use dates as criteria?
Yes. Put the date in quotes with an operator, such as ">=2024-01-01", or refer to a cell that contains a date.
Why does AVERAGEIFS return #DIV/0!?
It means no rows met all your criteria. Check for typos, extra spaces, or conditions that are too strict, and consider wrapping the formula in IFERROR.
Does AVERAGEIFS work with wildcards?
Yes, for text criteria. Use * for any number of characters and ? for a single character, for example "North*".
Can I average a range that contains text or blanks?
Yes. AVERAGEIFS ignores text, logical values, and empty cells in the average range, so only numbers are averaged.
Related functions
Every example on this page was recalculated by SheetSkill’s spreadsheet engine. AVERAGEIFS reference