AVERAGEIFS: Calculate Conditional Averages with Multiple Criteria

AVERAGEIFS Formula in Excel Blogpost Feature Image
Learn how to use AVERAGEIFS in Excel to average data with multiple conditions. Covers text, numeric, date, and wildcard criteria, OR logic workarounds, and common errors.

AVERAGEIF handles one condition. Most real datasets, however, require several at once. You might need the average sales only for the East region in Q2 — two conditions simultaneously. The AVERAGEIFS function solves this directly. It averages a range of numbers against up to 127 separate conditions and returns a single result. All conditions must be met at the same time — AVERAGEIFS uses AND logic, not OR.

Consequently, AVERAGEIFS is the go-to function for conditional analysis in sales reports, HR data, quality control, and financial dashboards. Furthermore, it accepts text, numbers, dates, wildcards, and cell references as criteria — making it flexible for almost any filtering task.

Availability: AVERAGEIFS is available in Excel 2007 and all later versions, including Microsoft 365, Excel 2024, 2021, 2019, and 2016.

What Is the AVERAGEIFS Syntax?

AVERAGEIFS follows the same pattern as SUMIFS and COUNTIFS — one average range, then criteria in range/criteria pairs.

=AVERAGEIFS( average_range, criteria_range1, criteria1, [criteria_range2, criteria2], ... )
ArgumentRequired?What it does
average_rangeRequiredThe range of numbers to average. Empty cells, text, and TRUE/FALSE values in this range are ignored. Zero values are included.
criteria_range1RequiredThe first range to evaluate. Must be the same size and shape as average_range.
criteria1RequiredThe condition to apply to criteria_range1. Can be text, a number, a date, a logical expression in quotes, or a cell reference.
criteria_range2, criteria2...OptionalAdditional range/criteria pairs. Up to 127 pairs are allowed. All conditions must be TRUE for a row to be included in the average.
Note the argument order: Unlike AVERAGEIF (where average_range comes last), AVERAGEIFS puts average_range first. Getting this wrong is the most common AVERAGEIFS mistake. Additionally, each criteria_range must be exactly the same size as average_range — otherwise a #VALUE! error appears.

How to Write Criteria in AVERAGEIFS

Criteria can be written in several ways. Text and exact-match numbers are the simplest. Operators like greater-than or less-than must be enclosed in double quotes. When the threshold comes from another cell, concatenate the operator string with the cell reference using &.

Criteria goalExample syntaxMeaning
Exact text match"East"Region equals "East" (case-insensitive)
Exact number match100Value equals exactly 100
Greater than">500"Value is above 500
Less than or equal to"<=100"Value is 100 or below
Not equal to text"<>Cancelled"Value is anything except "Cancelled"
Cell reference threshold">="&D2Value is greater than or equal to whatever is in D2
Wildcard — starts with"North*"Text begins with "North" (any suffix)
Wildcard — contains"*Pro*"Text contains "Pro" anywhere
Not blank"<>"Cell is not empty
Date before (from cell)"<"&E2Date is earlier than the date in E2

Example 1: Two Text Criteria

Two-condition filtering is the most common use of AVERAGEIFS. A typical scenario is averaging sales for a specific product in a specific region. Both conditions must be met — neither alone is sufficient for a row to be included.

1
Average sales for Widget orders in the East region only
A — Product
B — Region
C — Sales
Included?
Widget
East
£420
✓ Yes
Widget
West
£380
✕ Region mismatch
Gadget
East
£510
✕ Product mismatch
Widget
East
£560
✓ Yes
AVERAGEIFS result (420+560)/2:
£490
Average C2:C100 where A = "Widget" AND B = "East": =AVERAGEIFS(C2:C100, A2:A100, "Widget", B2:B100, "East") Using cell references for criteria — better for interactive dashboards: E1 holds "Widget", E2 holds "East". =AVERAGEIFS(C2:C100, A2:A100, E1, B2:B100, E2) Add a third condition — filter by sales rep (column D) stored in cell E3: =AVERAGEIFS(C2:C100, A2:A100, E1, B2:B100, E2, D2:D100, E3)
Only the two Widget/East rows (£420 and £560) meet both conditions. Their average is £490. Other rows fail at least one condition and are excluded entirely — not averaged at zero.

Example 2: Numeric Operator Criteria

Operators like greater than, less than, and not equal to allow you to filter rows by numeric thresholds. Enclose every operator inside double quotes. When the threshold comes from a cell reference, join the operator string with the reference using &.

2
Average salary for employees with 3+ years of service and a rating above 7
Column B = Years of service, Column C = Rating (1-10), Column D = Salary. Average salary where years >= 3 AND rating > 7: =AVERAGEIFS(D2:D100, B2:B100, ">=3", C2:C100, ">7") Dynamic thresholds — G1 holds the years threshold, G2 holds the rating threshold: Use & to join the operator with the cell reference. =AVERAGEIFS(D2:D100, B2:B100, ">="&G1, C2:C100, ">"&G2) Average sales within a numeric band — between 500 and 2000 inclusive. Use the same column for both criteria_range arguments. =AVERAGEIFS(C2:C100, C2:C100, ">=500", C2:C100, "<=2000")
Operator inside quotes, cell reference outside: Writing ">=G1" compares against the literal text "G1" — almost certainly wrong. Instead, write ">="&G1. Excel evaluates G1 first, then joins the result to the operator string.

Example 3: Date Range Criteria

AVERAGEIFS works naturally with dates. A between-dates filter requires two conditions on the same date column — one for the start boundary and one for the end. Both use the concatenation pattern for operators and cell references.

3
Average order value for orders placed within a date range — Q1 2026
A — Order date
B — Value
In Q1 2026?
Included?
15-Jan-2026
£640
Yes
08-Feb-2026
£480
Yes
02-Apr-2026
£820
No (Q2)
22-Mar-2026
£710
Yes
Q1 2026 average (640+480+710)/3:
£610
G1 holds 01-Jan-2026 (start). G2 holds 31-Mar-2026 (end). Average order value where date >= G1 AND date <= G2: =AVERAGEIFS(B2:B100, A2:A100, ">="&G1, A2:A100, "<="&G2) Hard-coded boundary — use DATE() to avoid regional format issues: DATE(2026,1,1) is always 1 January 2026, regardless of locale settings. =AVERAGEIFS(B2:B100, A2:A100, ">="&DATE(2026,1,1), A2:A100, "<="&DATE(2026,3,31)) Dynamic current-month average — EOMONTH returns the last day of the month: =AVERAGEIFS(B2:B100, A2:A100, ">="&EOMONTH(TODAY(),-1)+1, A2:A100, "<="&EOMONTH(TODAY(),0))
Dates must be stored as dates, not text: If the date column contains text that looks like a date — such as "01/01/2026" stored as a string — comparisons using >= and <= silently fail. Verify with ISNUMBER on the date column. Genuine dates return TRUE; text dates return FALSE.

Example 4: Wildcard Criteria for Partial Text Matching

AVERAGEIFS supports the same wildcard characters as COUNTIFS and SUMIFS. An asterisk (*) matches any number of characters. A question mark (?) matches exactly one character. Wildcards are particularly useful for category columns where entries may carry varying suffixes or prefixes.

4
Average all sales where the product name starts with "Widget" — any suffix
* matches zero or more characters. "Widget*" matches Widget, Widget Pro, Widget Lite, WidgetXL etc. =AVERAGEIFS(C2:C100, A2:A100, "Widget*") Contains — "*Pro*" matches anything with "Pro" anywhere in the text: =AVERAGEIFS(C2:C100, A2:A100, "*Pro*") Combine wildcard with a second exact criterion: Average Widget* sales in the East region only. =AVERAGEIFS(C2:C100, A2:A100, "Widget*", B2:B100, "East") Dynamic wildcard from a cell — concatenate * with the prefix in G1: If G1 = "Widget", this searches for "Widget*". =AVERAGEIFS(C2:C100, A2:A100, G1&"*") ? matches exactly one character: "Widge?" matches "Widget" but NOT "WidgetPro". =AVERAGEIFS(C2:C100, A2:A100, "Widge?")
AVERAGEIFS is not case-sensitive — "Widget*" matches "widget", "WIDGET", and "Widget Pro" equally. To escape a literal asterisk or question mark in the data, prefix it with a tilde: "~*" matches a real asterisk character.

Example 5: AVERAGEIF vs AVERAGEIFS — When to Use Each

AVERAGEIF handles one condition and uses a different argument order. AVERAGEIFS handles one or more conditions and always places average_range first. For new formulas, AVERAGEIFS is generally the better choice — the consistent argument order reduces mistakes when adding more criteria later.

The Key Argument Order Difference

AVERAGEIF places average_range last when three arguments are provided. AVERAGEIFS, by contrast, always places it first. This inconsistency catches many users off guard — particularly when migrating a formula from one function to the other.

5
Side-by-side — same result, but different argument order between the two functions
AVERAGEIF — single condition. Average_range is the LAST argument: =AVERAGEIF(criteria_range, criteria, average_range) =AVERAGEIF(B2:B100, "East", C2:C100) AVERAGEIFS — one or more conditions. Average_range is the FIRST argument: =AVERAGEIFS(average_range, criteria_range1, criteria1, ...) =AVERAGEIFS(C2:C100, B2:B100, "East") Identical result — different argument order Adding a second condition is trivial with AVERAGEIFS — simply append a pair. That is not possible without restructuring AVERAGEIF. =AVERAGEIFS(C2:C100, B2:B100, "East", A2:A100, "Widget")
Prefer AVERAGEIFS even for a single condition: Using AVERAGEIFS consistently means the argument order is always the same. Furthermore, adding conditions later requires no restructuring — just append a new range/criteria pair at the end of the formula.

Example 6: OR Logic Workaround

AVERAGEIFS uses AND logic only. There is no built-in OR mode. To average rows where condition A OR condition B is met, calculate each group separately and combine them. The SUMIFS and COUNTIFS approach avoids double-counting when rows could match both conditions.

Why Not Average Two AVERAGEIFS Results?

Simply averaging two AVERAGEIFS results gives the wrong answer when group sizes differ. For instance, three East sales and ten West sales would produce an incorrect overall average if you just average the two group results. SUMIFS divided by COUNTIFS handles unequal group sizes correctly.

6
Average sales for East OR West region — correct weighted mean without double-counting
Correct OR average — SUMIFS divided by COUNTIFS. Each function tallies its own group; dividing gives the true weighted mean. =(SUMIFS(C2:C100, B2:B100, "East") +SUMIFS(C2:C100, B2:B100, "West")) /(COUNTIFS(B2:B100, "East") +COUNTIFS(B2:B100, "West")) Excel 365 alternative — FILTER extracts matching rows; AVERAGE runs on that array. The + between Boolean arrays creates OR logic. AVERAGE(FILTER(C2:C100, (B2:B100="East") + (B2:B100="West"))) Wrong approach — averaging two group averages gives incorrect weights. Avoid this whenever group sizes are unequal. Incorrect: =(AVERAGEIFS(C:C,B:B,"East")+AVERAGEIFS(C:C,B:B,"West"))/2
The SUMIFS/COUNTIFS approach is the safest and works in all Excel versions. In Excel 365, AVERAGE(FILTER(...)) is cleaner — especially when the OR list grows beyond two values.

How to Fix Common AVERAGEIFS Errors

#DIV/0! — no rows matched all conditions

AVERAGEIFS returns #DIV/0! when no rows satisfy every condition simultaneously. There is nothing to average, so no result is possible. Check each criterion individually to find which one excludes all rows. Wrapping in IFERROR is good practice for dashboards: =IFERROR(AVERAGEIFS(...), "No data").

#VALUE! — mismatched range sizes

Every criteria_range must be exactly the same size as average_range. For example, if average_range is C2:C100 (99 rows), each criteria_range must also cover 99 rows. A common mistake is accidentally including the header row in one range but not another.

Formula returns zero or a wrong number

Two likely causes exist. First, the average_range may contain numbers stored as text — use VALUE() to convert them. Second, a numeric criterion may be written as text without concatenation, such as ">=G1" instead of ">="&G1". Additionally, check whether dates in criteria columns are genuine dates by running ISNUMBER on a sample cell.

Zero values are included; blank cells are not: AVERAGEIFS counts zero as a valid numeric value and includes it in the calculation. Empty cells in the average_range, however, are ignored. If zeros represent missing data rather than genuine zeroes, add a condition: "<>0" on the average_range column to exclude them.

Frequently Asked Questions

  • What is the difference between AVERAGEIF and AVERAGEIFS?+
    AVERAGEIF handles exactly one condition and uses the argument order (criteria_range, criteria, average_range). AVERAGEIFS handles one or more conditions and uses the order (average_range, criteria_range1, criteria1, ...). The key difference is that average_range comes first in AVERAGEIFS and last in AVERAGEIF. For new formulas, AVERAGEIFS is the better choice even with a single condition — its argument order stays consistent as conditions are added.
  • How do I use a cell reference as a criterion in AVERAGEIFS?+
    For exact matches, use the cell reference directly: =AVERAGEIFS(C:C, B:B, G1). For comparisons with operators, concatenate the operator string with the reference using &: =AVERAGEIFS(C:C, B:B, ">="&G1). This is necessary because Excel must evaluate G1 to get its value before joining it with the operator. Writing ">=G1" would compare against the literal text string "G1" rather than the value in the cell.
  • Why does AVERAGEIFS return #DIV/0!?+
    AVERAGEIFS returns #DIV/0! when no rows satisfy all conditions simultaneously. Check each criterion individually to find which one excludes all data. Common causes are a typo in a text criterion, a date stored as text, or a numeric threshold that no value meets. AVERAGEIFS is case-insensitive but not whitespace-insensitive — a trailing space in a cell value can cause a mismatch. Wrap the formula in IFERROR to return a friendly message instead of the error.

More Questions About AVERAGEIFS

  • Can AVERAGEIFS use OR logic?+
    Not directly — AVERAGEIFS always uses AND logic. For OR logic, calculate each group separately with SUMIFS and COUNTIFS, then divide: =(SUMIFS(C:C,B:B,"East")+SUMIFS(C:C,B:B,"West"))/(COUNTIFS(B:B,"East")+COUNTIFS(B:B,"West")). In Excel 365, AVERAGE(FILTER(C2:C100,(B2:B100="East")+(B2:B100="West"))) is a cleaner alternative. The + between Boolean arrays creates OR logic for the FILTER function.
  • Do wildcards work in AVERAGEIFS?+
    Yes. AVERAGEIFS supports the asterisk (*) for any sequence of characters and the question mark (?) for exactly one character. For example, "North*" matches "North", "NorthEast", and "NorthWest". To combine a wildcard with a cell reference, concatenate: G1&"*" where G1 holds the prefix text. To match a literal asterisk or question mark in the data, precede it with a tilde character: "~*" matches a real asterisk.
  • Which Excel versions support AVERAGEIFS?+
    AVERAGEIFS is available in Excel 2007 and all later versions, including Microsoft 365, Excel 2024, 2021, 2019, and 2016. It also works in Excel for the web and Google Sheets. The older AVERAGEIF function is available from Excel 2003 onwards and handles single-condition averaging only.