Quick Answer

AVERAGEIF Function

Averages values that satisfy one condition.

✓ Excel✓ Google SheetsExcel Excel 2007+

Syntax

AVERAGEIF
(range, criteria, [average_range])

Parameters

ParameterDescriptionRequired
rangeThe range to evaluate against the criteria.Required
criteriaThe condition that determines which cells to average.Required
average_rangeThe actual cells to average. If omitted, range is used.Optional

Basic Example

Average score for a specific class

=AVERAGEIF(A2:A100, "Class A", B2:B100)
ResultAverage Class A score

Averages values in B2:B100 only where A2:A100 is "Class A".

Advanced Examples

Example 1: Average above a threshold

Sales performance

Average sales greater than 1000

=AVERAGEIF(B2:B100, ">1000")
Result: Average of high sales
Only values above 1000 are included in the average.

How AVERAGEIF Works

AVERAGEIF evaluates the criteria against each cell in range. For matching cells, it averages the corresponding value from average_range (or range itself if average_range is omitted).

1
Select criteria range
Choose the range to test.
2
Enter criteria
Type the condition.
3
Select average range
Choose the values to average (optional).

Important Notes & Limitations

  • Only one criterion is supported.

  • Criteria ranges must match average_range in size.

  • Empty cells in average_range are ignored.

Common Errors & Fixes

#DIV/0! errorNo cells match the criteria.

Fix: Check that the criteria is correct and that matching values exist.

Wrong averageText values in average_range are ignored.

Fix: Convert text to numbers.

Download Practice File

Practice AVERAGEIF with Real Data

Download a sample CSV file with pre-populated data and practice exercises for the AVERAGEIF function. Works in both Excel and Google Sheets.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Related Tutorials

Frequently Asked Questions

What is the difference between AVERAGEIF and AVERAGEIFS?
AVERAGEIF handles one criterion. AVERAGEIFS handles multiple criteria.
Can AVERAGEIF use wildcards?
Yes, * and ? are supported.
What happens if no cells match?
Returns #DIV/0!.