AVERAGEIF

AVERAGEIF returns the average of cells in a range that meet a single condition. The arithmetic mean of just the matches, ignoring everything else. Sister function to SUMIF and COUNTIF, with the same argument shape and wildcard support.

Math & StatsIntermediate
Purpose
Return the arithmetic mean of cells in a range that meet a single criterion.
Returns
A single number, the average of the matched cells
Syntax
=AVERAGEIF(range, criteria, [average_range])
Excel version
All versions since Excel 2007

How AVERAGEIF works

AVERAGEIF walks through the criteria range, checks each cell against your condition, and averages the matching values from the average_range. If you skip the third argument, it averages the criteria range itself (single-column shortcut for numeric thresholds).

Criteria can be a literal value ("North"), a comparison string (">1000", "<>0"), a cell reference (E1), or a wildcard pattern ("PO-*"). The same flexibility you have in SUMIF and COUNTIF, just averaged instead of summed or counted.

Empty cells in the average_range are skipped (they don't drag the average toward zero). Cells containing text or errors are also skipped. Zero values ARE included, so a row with $0 in revenue pulls the average down, which is usually what you want for a true mean.

= AVERAGEIF(range, criteria, [average_range])

Arguments

ArgumentTypeRequiredDescription
rangerange✓ RequiredThe cells to check against the criterion. Usually the column holding your category, region, status, etc.
criteriaany✓ RequiredWhat counts as a match. Text in quotes ("North"), a comparison string (">1000", "<>Cancelled"), a cell reference (E1), or a wildcard pattern ("PO-*", "*finance*").
average_rangerange✗ OptionalThe cells whose values to actually average. Same height as range. Omit to average the range itself (useful for numeric thresholds like ">1000" against a single column).

AVERAGEIF basic: average sales of North reps

Sales reps in column A with their region in B and Q4 sales in C. Question for the VP: what was the average Q4 sales per North rep? AVERAGEIF reads the region column, picks the rows where region equals North, and averages the matching Q4 numbers.

=AVERAGEIF(B2:B11, "North", C2:C11)
  • B2:B11 -> the region column (criteria range)
  • "North" -> the literal text to match, in quotes
  • C2:C11 -> the column to actually average (Q4 sales)
  • Three Norths -> rows 2, 5, and 8 match. AVERAGEIF averages just those three numbers.
  • Result -> $4,800 - the mean of $4,200, $5,800, and $4,400
E2
fx
=AVERAGEIF(B2:B11, "North", C2:C11)
ABCDEFGH
1Sales repRegionQ4 salesAvg North
2Sarah ChenNorth$4,200$4,800← formula
3James MillerSouth$3,800
4Maria SantosEast$5,100
5David BrownWest$4,500
6Emma DavisNorth$5,800
7Alex KimSouth$3,200
8Carlos GomezEast$6,200
9Jenny LiuNorth$4,400
10Mark ReillyWest$3,900
11Rachel WoodSouth$4,100
Formula entered in cell E2. AVERAGEIF returns the mean of the three Q4-sales values where Region equals North.
Three rows are North: Sarah ($4,200), Emma ($5,800), Jenny ($4,400). Their mean is $4,800. The other seven rows are ignored.

AVERAGEIF with comparison: average orders above $1,000

Two-argument AVERAGEIF: pass only the range and a comparison string, and Excel averages the cells in that range that match. Useful when you want the mean of values above or below a threshold without a separate criteria column.

=AVERAGEIF(B2:B11, ">1000")
  • B2:B11 -> the order-amount column (acts as both range and average_range)
  • ">1000" -> comparison criterion - strictly greater than 1000
  • No third arg -> Excel uses the range itself as the average_range
  • Five rows above $1,000 -> PO-1002, PO-1004, PO-1005, PO-1007, PO-1009
  • Result -> $2,764 - the mean of $2,400 + $3,150 + $1,250 + $5,020 + $2,000 = $13,820 / 5
D2
fx
=AVERAGEIF(B2:B11, ">1000")
ABCDEFG
1OrderAmountAvg over $1k
2PO-1001$450$2,764← formula
3PO-1002$2,400
4PO-1003$890
5PO-1004$3,150
6PO-1005$1,250
7PO-1006$700
8PO-1007$5,020
9PO-1008$320
10PO-1009$2,000
11PO-1010$580
Formula entered in cell D2. Two-argument form - Excel averages the same column the criterion checks against.
Five orders cleared $1,000 (highlighted green). Sum of those five is $13,820. Mean is $13,820 / 5 = $2,764.
The comparison operator goes INSIDE the quotes, never outside. ">1000" is correct; > "1000" is a #VALUE! error.

AVERAGEIF with wildcards: average POs by prefix

Wildcards work the same way as in SUMIF and COUNTIF. Use `*` to match any string of characters and `?` to match a single character. Useful when product codes have a category prefix and you want the average for one category.

=AVERAGEIF(A2:A11, "PO-*", B2:B11)
  • A2:A11 -> the order-code column
  • "PO-*" -> matches any code starting with PO-
  • B2:B11 -> the amount column to average
  • Six PO- codes -> the rest are ON- (online) or SR- (subscription)
  • Result -> $2,115 - sum of $450 + $2,400 + $3,150 + $1,250 + $5,020 + $420 = $12,690 divided by 6
D2
fx
=AVERAGEIF(A2:A11, "PO-*", B2:B11)
ABCDEFG
1CodeAmountAvg PO orders
2PO-1001$450$2,115← formula
3PO-1002$2,400
4ON-2001$130
5PO-1004$3,150
6SR-3001$50
7PO-1005$1,250
8ON-2002$210
9PO-1007$5,020
10SR-3002$75
11PO-1009$420
Formula entered in cell D2. The * wildcard catches any suffix after PO-. Match by prefix, average by amount.
Six codes start with PO- (highlighted green). Their amounts sum to $12,690; divided by 6 the mean is $2,115. The ON- and SR- rows are excluded.

AVERAGEIFS: multiple criteria at once

When one criterion is not enough, AVERAGEIFS lets you stack them. The argument order is different from AVERAGEIF: average_range comes FIRST, then the criteria pairs.

Below: average salary of employees who are both in Engineering AND have status Active. A row has to clear BOTH filters to be included.

=AVERAGEIFS(C2:C11, A2:A11, "Engineering", B2:B11, "Active")
  • C2:C11 -> the column to average (Salary) - comes FIRST in AVERAGEIFS
  • A2:A11, "Engineering" -> first criteria pair: department equals Engineering
  • B2:B11, "Active" -> second criteria pair: status equals Active
  • Three matches -> Sarah, James, and Alex are all Engineering + Active
  • Result -> $91,333 - the mean of $95,000, $88,000, $91,000
F2
fx
=AVERAGEIFS(C2:C11, A2:A11, "Engineering", B2:B11, "Active")
ABCDEFGHI
1DepartmentStatusSalaryAvg active eng
2EngineeringActive$95,000$91,333← formula
3EngineeringActive$88,000
4MarketingActive$72,000
5EngineeringOn Leave$102,000
6SalesActive$68,000
7EngineeringActive$91,000
8OperationsActive$75,000
9MarketingActive$78,000
10EngineeringTerminated$85,000
11EngineeringActive
Formula entered in cell F2. AVERAGEIFS argument order flips: average_range comes first, then range/criteria pairs.
Five engineers in the table, but only three are also Active. Their salaries are $95k + $88k + $91k = $274k; mean is $91,333.
Argument order flips between AVERAGEIF and AVERAGEIFS. AVERAGEIF: range, criteria, [avg_range]. AVERAGEIFS: avg_range FIRST, then range/criteria pairs. This trips up everyone the first time.

AVERAGEIFS by date range: monthly KPI snapshot

Stack two date criteria to constrain a window. Use >= for the start date and <= for the end date. Same shape as before, just both criteria range to the same column.

=AVERAGEIFS(B2:B11, A2:A11, ">=2026-03-01", A2:A11, "<=2026-03-31")
  • B2:B11 -> the order-amount column (average_range)
  • A2:A11, ">=2026-03-01" -> first criteria: dates on or after March 1
  • A2:A11, "<=2026-03-31" -> second criteria: dates on or before March 31
  • Three March rows -> the 8th, 14th, and 27th
  • Result -> $1,217 - mean of $980, $1,420, $1,250
D2
fx
=AVERAGEIFS(B2:B11, A2:A11, ">=2026-03-01", A2:A11, "<=2026-03-31")
ABCDEFG
1Order dateAmountAvg in March
22026-02-12$640$1,217← formula
32026-02-27$1,830
42026-03-08$980
52026-03-14$1,420
62026-03-27$1,250
72026-04-02$2,100
82026-04-15$540
92026-04-29$3,420
102026-05-04$1,870
112026-05-11$2,950
Formula entered in cell D2. Both criteria reference the same date column to bracket the window between two dates.
Three rows fall inside March 2026 (highlighted green): $980 + $1,420 + $1,250 = $3,650 over three orders. The mean is $1,217.
For monthly dashboards, parameterize the dates with EOMONTH or two input cells. Then the dashboard updates by typing a single month into the input.

Where people go wrong

  1. Argument order flip between AVERAGEIF and AVERAGEIFS

    AVERAGEIF takes range, criteria, [avg_range]. AVERAGEIFS takes avg_range FIRST, then pairs of range/criteria. Copying an AVERAGEIF and adding an extra pair gives a #VALUE! error because the first range is in the wrong slot.

    Fix: Rewrite from scratch when you switch to AVERAGEIFS. Put the column you want to average first, then add criteria pairs. Same rule applies to SUMIFS, MAXIFS, MINIFS.
  2. Comparison operator outside the quotes

    Writing AVERAGEIF(B2:B11, > 1000) returns #NAME? because Excel can't parse the comparison without the operator and the value being a single string.

    Fix: Always wrap the comparison: ">1000", "<=500", "<>0". If the threshold lives in a cell, concatenate: ">" & E1.
  3. Empty match returns #DIV/0!

    If zero rows match the criteria, AVERAGEIF divides by zero and returns #DIV/0!. The report breaks visibly in front of a stakeholder.

    Fix: Wrap with IFERROR for production reports: =IFERROR(AVERAGEIF(...), 0) or =IFERROR(AVERAGEIF(...), "No data"). For lookups specifically, prefer IFNA so genuine bugs still surface.
  4. Treating zeros as missing data

    AVERAGEIF includes zero values in its calculation. A column with $0 entries for products that didn't sell that week pulls the average down. Sometimes that's correct (true mean), sometimes it's not (you wanted sales-day average).

    Fix: Decide what zero means in your data. If zero means "no sale that week" and you want the per-active-week mean, add a second criterion: AVERAGEIFS(..., range, "<>0"). Excludes the zeros from the divisor.

Notes

  • Available in every Excel version since 2007. AVERAGEIFS arrived in 2007 too.
  • Text criteria are case-insensitive. "North" and "north" match the same rows.
  • Wildcards: * matches any string, ? matches one character. Use ~* or ~? to match a literal asterisk or question mark.
  • Empty cells in the average_range are skipped. They don't pull the mean toward zero.
  • Zero values ARE included. If you want to exclude zeros, add a "<>0" criterion via AVERAGEIFS.
  • Empty matches return #DIV/0!. Wrap with IFERROR for production reports.
  • AVERAGEIFS argument order: average_range FIRST, then range/criteria pairs. Different from AVERAGEIF.
  • For weighted averages (different weights per row), AVERAGEIF won't do it. Use SUMPRODUCT instead.

Now prove it

Reading about AVERAGEIF is one thing.

Writing one in a board-meeting deck at 8am, where the CFO is staring at the screen and the average needs to be the average of just the rows that match three different filters, is completely different.

These exercises drop AVERAGEIF into real workplace patterns: regional averages, weighted KPIs, conditional means, date-bounded snapshots.

Here's the thing about AVERAGEIF.

You can read this page twice and still hesitate when a manager asks for the average revenue of active accounts in the East region for orders over $1,000 placed in the last 30 days.

That gap, between knowing what AVERAGEIF does and being able to write one fluently while someone is waiting, is exactly what CellSkill is built to close.

Not with more reading.

With practice on scenarios that look like your actual job.

Start practicing AVERAGEIF for free →
Free account . No credit card . Cancel anytime
Practice AVERAGEIF
AVERAGEIF in Excel: Conditional Averages Made Simple · CellSkill