AVERAGEIF Function in Excel
Master the AVERAGEIF function to calculate conditional averages. Learn syntax, examples, and error solutions for Excel and Google Sheets.




=AVERAGEIF(range, criteria, [average_range])
Practical Examples
Basic Sales Average
Calculate average sales for amounts greater than 5000
Department Performance Metrics
Average employee performance scores by department
Text Criteria Matching
Average prices for products containing specific text
Date-Based Averaging
Calculate average sales for specific months
Excluding Zeros and Blanks
Calculate average excluding zero values
Cell Reference as Criteria
Using another cell value as the criteria
Common Errors and Solutions
Division by zero - no cells meet criteria
AVERAGEIF returns #DIV/0! when no cells match the specified criteria, resulting in an attempt to divide by zero
1. Verify your criteria is correctly formatted 2. Check that data exists matching your condition 3. Use IFERROR to handle gracefully: =IFERROR(AVERAGEIF(...), 0) 4. Confirm ranges contain numeric values
Always validate that your criteria will match at least one cell before using AVERAGEIF
Example:
Invalid data type in formula
Text values in the average_range or incorrectly formatted criteria syntax
1. Ensure average_range contains only numbers 2. Check criteria syntax (use quotes for text) 3. Remove any text from numeric columns 4. Use VALUE() to convert text numbers
Clean your data before applying AVERAGEIF; ensure numeric columns contain only numbers
Function name not recognized
Misspelled function name or using AVERAGEIF in Excel versions before 2007
1. Check spelling: AVERAGEIF not AVGIF 2. Verify Excel version supports AVERAGEIF (2007+) 3. For older versions, use: =SUMIF(range,criteria)/COUNTIF(range,criteria)
Use Excel's formula autocomplete feature to avoid typos
Average seems incorrect
Misaligned ranges or incorrect criteria operators
1. Ensure range and average_range have same dimensions 2. Verify comparison operators (>, <, >=, <=) 3. Check for hidden rows or filtered data 4. Confirm criteria matches intended cells
Test with small sample data first to verify formula logic
Example:
Best Practices and Pro Tips
Leverage wildcards (* for multiple characters, ? for single) to create powerful text patterns. Example: '*Sales*' matches any text containing 'Sales'.
For large datasets (>10,000 rows), use specific ranges like B2:B10000 instead of entire columns (B:B) to improve calculation speed by up to 50%.
AVERAGEIF includes hidden and filtered rows in calculations. Use AGGREGATE function with option 5 to exclude hidden rows if needed.
Nest AVERAGEIF within ROUND for cleaner results: =ROUND(AVERAGEIF(A:A,'>100',B:B),2) rounds to 2 decimal places.
AVERAGEIF is not case-sensitive for text criteria. 'Sales' and 'SALES' are treated as identical. Use SUMPRODUCT for case-sensitive averaging.
Need Help with AVERAGEIF Function in Excel?
Stop struggling with formula syntax. Use AskFormulas to generate validated formulas instantly with our AI-powered tool.
Example Excel formula:
Related Formulas
Master the AVERAGE function with practical examples and error solutions. Learn to calculate mean values and analyze data efficiently in Excel and Sheets.

Master the COUNTIF function to count cells that meet specific criteria. Learn syntax, practical examples, and error solutions for data analysis.

Master the SUMIF function with practical examples and error solutions. Learn how to sum cells based on criteria with step-by-step tutorials.

Master COUNTA to count non-empty cells in Excel & Sheets. Learn COUNT vs COUNTA, fix errors, and use practical examples.
