Excel Function

AVERAGEIF

Returns average for values matching a condition.

AVERAGEIF(range, criteria, [average_range])

Arguments

range

Required

Specify the range used for condition check or aggregation.

criteria

Required

Enter the match condition, e.g. "Food", ">=80", "<>0".

average_range

Optional

Specify the range of values to average.

Practice Preview

Use AVERAGEIF to calculate the average of Sales in column D where Category matches Food. You can set ranges by dragging from the start cell to the end cell in the same argument field.

Example Table

#
AProduct ID
BProduct Name
CCategory
DSales
2P001AppleFood1200
3P002BananaFood980
4P003NotebookStationery450
5P004PenStationery300
6P005GrapesFood1500
7P006RulerStationery250
8P007PeachFood860

How to Use (Formula)

=AVERAGEIF(C2:C8, "Food", D2:D8)

Result

1135

Practice This Function

AVERAGEIF FAQ

How do I use AVERAGEIF in Excel?

Use AVERAGEIF when you want to average values that match a condition. Enter Range, Criteria, Average range in that order, then add optional arguments when needed.

Where can I practice AVERAGEIF?

Use the "Start Function Practice" button to jump straight into AVERAGEIF drills.

What arguments does AVERAGEIF use?

The main arguments are Range, Criteria, Average range. Start with the required ones, then add optional arguments if needed.