The AVERAGEIF Function in Excel is a powerful tool for calculating the average (arithmetic mean) of cells that meet a specific condition. It’s ideal for data analysis when you want to focus on subsets of data.
At The Coding College, we simplify Excel tutorials to help you become a spreadsheet expert.
Syntax of the AVERAGEIF Function
The syntax for the AVERAGEIF Function is:
=AVERAGEIF(range, criteria, [average_range])
- range: (Required) The range of cells to evaluate.
- criteria: (Required) The condition or criteria to meet (e.g., a number, expression, or text).
- [average_range]: (Optional) The range of cells to average. If omitted, Excel uses the range parameter.
How Does the AVERAGEIF Function Work?
The function evaluates the range for the specified criteria and calculates the average of matching cells in the average_range.
Practical Example 1: Sales Above a Threshold
Suppose you want to calculate the average sales for months with sales above ₹15,000.
Month | Sales (₹) |
---|---|
January | 12000 |
February | 18000 |
March | 20000 |
Formula:
=AVERAGEIF(B2:B4, ">15000")

Practical Example 2: Average Scores for a Specific Subject
You want to calculate the average score for “Math” in the dataset below.
Subject | Score |
---|---|
Math | 85 |
Science | 90 |
Math | 78 |
Formula:
=AVERAGEIF(A2:A4, "Math", B2:B4)

Handling Blank Cells with AVERAGEIF
The AVERAGEIF Function ignores blank cells in both the range and average_range.
Example:
Value |
---|
10 |
20 |
(Blank) |
30 |
Formula:
=AVERAGEIF(A1:A4, ">10")

Using Wildcards in AVERAGEIF
The criteria parameter supports wildcards:
- ?: Represents a single character.
- *: Represents multiple characters.
Example: Matching Text with Wildcards
Product | Price (₹) |
---|---|
Apple | 100 |
Banana | 50 |
Apricot | 120 |
Formula:
=AVERAGEIF(A2:A4, "A*", B2:B4)

AVERAGEIF with Logical Operators
The AVERAGEIF Function supports logical operators like >, <, >=, <=, =, and <>.
Example: Exclude Zero Values
Value |
---|
0 |
50 |
100 |
Formula:
=AVERAGEIF(A1:A3, "<>0")

Common Errors in AVERAGEIF
- #DIV/0!: Returned when no cells meet the criteria.
- Incorrect Criteria Format: Use quotation marks around text or logical operators (e.g., “>10”).
Benefits of Using AVERAGEIF
- Targeted Averages: Analyze specific data subsets.
- Dynamic Calculations: Update results automatically with data changes.
- Flexibility: Supports numbers, text, dates, and wildcards.
Explore More with Excel
Mastering the AVERAGEIF Function opens doors to smarter data analysis. Practice combining it with functions like COUNTIF or SUMIF for advanced operations.
For more tutorials and insights, visit The Coding College, where coding and Excel come alive for learners like you!