Skip to main content

Conditional formula page

AVERAGEIF Formula

Use AVERAGEIF when one criteria range controls which numbers should be averaged.

Best for

Average values by one condition with AVERAGEIF.

What it returns

With the sample data, this averages Amount values for East rows.

Copy formulas

Excel formula
=AVERAGEIF(B2:B100, "East", D2:D100)
Google Sheets formula
=AVERAGEIF(B2:B100, "East", D2:D100)
Excel / Google Sheets difference

Excel and Google Sheets use AVERAGEIF for one condition. Matching numeric values are averaged while text and blank cells in the average range are ignored.

Example data

DateRegionProductAmountRep
2026-01-04EastWidget420Maya
2026-01-12WestWidget310Noah
2026-02-03EastGadget275Maya
2026-02-15EastWidget640Iris
What it returns

With the sample data, this averages Amount values for East rows.

How the formula works

  • B2:B100 chooses matching rows.
  • D2:D100 supplies the values to average.
  • Blank and nonnumeric values in the average range are ignored by spreadsheet rules.
Syntax pieceRole in the formula
B2:B100The criteria range containing Region or another category.
"East"The criterion selecting the rows to average.
D2:D100The average range containing the numeric values.
Non-numeric valuesText and blanks in the average range are ignored; numeric zero values are included.

Verified examples

Average East amounts
=AVERAGEIF(B2:B100, "East", D2:D100)

Excel: Use the sample sales table with East amounts averaging 445. Returns: 445

Average West from a cell
=AVERAGEIF(B2:B100,F2,D2:D100)

Google Sheets: Enter West in F2; the matching Amount values average 310. Returns: 310

Average Widget amounts
=AVERAGEIF(C2:C100,"Widget",D2:D100)

Excel: Use Widget in C2:C100; matching Amount values average 456.67 when rounded to two decimals. Returns: 456.67 (rounded to two decimals)

Common errors and fixes

IssueLikely causeFix
AVERAGEIF returns #DIV/0!No matching rows contain numeric values in the average range.Check the criterion and convert matching values to numbers, or wrap the formula in IFERROR when no match is a valid state.
The average uses values from the wrong rowsThe criteria range and average range have different row boundaries.Align both ranges, such as B2:B100 and D2:D100.
Zeros change the result but blanks do notA numeric zero is a real value and participates in the average, while blanks and text are ignored.Decide whether zero represents a measured value; remove or transform it before averaging if it should be excluded.

When not to use this formula

  • Do not use AVERAGEIF when several independent conditions must be applied; use AVERAGEIFS instead.

Alternatives

AlternativeWhen to use it
AVERAGEIFS FormulaUse when the average must satisfy multiple conditions.
SUMIF FormulaUse when the matching numeric values should be totaled rather than averaged.

Related formulas

Official references

FAQ

Are blanks and text included in the average?

No. AVERAGEIF ignores blanks and text in the average range, but it includes numeric zeros.

When should I use AVERAGEIFS?

Use AVERAGEIFS when the average must satisfy two or more criteria, such as Region plus Product.