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.
Returns average for values matching a condition.
AVERAGEIF(range, criteria, [average_range])range
RequiredSpecify the range used for condition check or aggregation.
criteria
RequiredEnter the match condition, e.g. "Food", ">=80", "<>0".
average_range
OptionalSpecify the range of values to average.
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.
| # | AProduct ID | BProduct Name | CCategory | DSales |
|---|---|---|---|---|
| 2 | P001 | Apple | Food | 1200 |
| 3 | P002 | Banana | Food | 980 |
| 4 | P003 | Notebook | Stationery | 450 |
| 5 | P004 | Pen | Stationery | 300 |
| 6 | P005 | Grapes | Food | 1500 |
| 7 | P006 | Ruler | Stationery | 250 |
| 8 | P007 | Peach | Food | 860 |
How to Use (Formula)
=AVERAGEIF(C2:C8, "Food", D2:D8)Result
1135
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.
Use the "Start Function Practice" button to jump straight into AVERAGEIF drills.
The main arguments are Range, Criteria, Average range. Start with the required ones, then add optional arguments if needed.