What is the AVERAGEIF Function
The AVERAGEIF function calculates the average of only those numbers that meet a condition you specify. It works like AVERAGE but adds a filter. This is very useful when you want to know the average of a specific category, region, department, or any other group.
Formula: =AVERAGEIF(range, criteria, [average_range])
Practical Example 1
Column A contains department names and column B contains salaries. You want the average salary of the HR department only.
Type: =AVERAGEIF(A2:A6, HR, B2:B6)
Result: the average HR salary
Practical Example 2
Column A contains regions and column B contains sales. You want the average sales in Dhaka.
Type: =AVERAGEIF(A2:A100, Dhaka, B2:B100)
Result: the average Dhaka sales figure
Practical Example 3
You want the average of numbers greater than 50 in a range.
Type: =AVERAGEIF(B2:B10, >50)
Result: the average of numbers above 50 only
When to Use It
AVERAGEIF is used in HR for department-wise average salaries, in sales for region-wise average revenue, in education for subject-wise average marks, and in any report that needs a filtered average.