DAVERAGE Function in Excel
Master DAVERAGE to calculate database averages with multiple criteria. Learn syntax, examples, and solutions for Excel and Google Sheets.
=DAVERAGE(database, field, criteria)Quick Answer
DAVERAGE function DAVERAGE function calculates the average of database values matching multiple criteria. Use `=DAVERAGE(database, field, criteria)` where database is your data range with headers, field is the column to average, and criteria is a separate range with filter conditions.
=DAVERAGE(database, field, criteria)DAVERAGE Examples with Real Data
Calculate Average Sales for North Region
Basic single-criterion averaging from a sales database
Average Sales for North Region AND Widget A Product
Multiple AND criteria filtering across different fields
Average Sales for North OR South Regions
OR logic with multiple criteria rows
Average Sales Above $1,000 for North Region
Combining field matching with comparison operators
Sales Report with User-Selected Region Filter
Dynamic criteria using cell references for interactive dashboards
Common DAVERAGE Errors and Fixes
DAVERAGE returns #DIV/0! error
No records in the database match the specified criteria, resulting in division by zero when calculating the average. This is the most common DAVERAGE error.
1. Verify criteria are correct and match database values exactly 2. Check for typos in criteria field names (must match headers exactly) 3. Review criteria operators – ensure '>100' not 'greater than 100' 4. Check for leading/trailing spaces in criteria or data 5. Use IFERROR for graceful handling: =IFERROR(DAVERAGE(database, field, criteria), 'No matches found') 6. Test with DCOUNT to verify if any records match: =DCOUNT(database, field, criteria)
Before deploying formulas, test criteria range against a small data sample to confirm at least one match exists. Use DCOUNT to verify match count before implementing DAVERAGE.
Example:
DAVERAGE returns #VALUE! error
Field parameter doesn't match any column header in the database range, or criteria range structure is incorrect. Even a small typo or extra space causes this error.
1. Verify field name matches database header exactly (case-sensitive in some versions) 2. Check that database range includes header row 3. Ensure criteria range has headers in first row 4. If using column number for field, verify it's within database range columns 5. Remove any extra spaces from field names: use TRIM() on headers if needed 6. Copy-paste headers from database to criteria range to ensure exact match
Use data validation or formula references to field names to prevent typos. Named ranges help maintain consistency. Always copy-paste headers rather than retyping them.
Example:
Formula returns a number but it's wrong
Database range doesn't include all data, field parameter references wrong column, or criteria logic misunderstood (confusing AND/OR logic).
1. Verify database range includes all relevant rows and columns 2. Check that field parameter matches intended calculation column 3. Review criteria logic: remember same row = AND, different rows = OR 4. Test criteria range separately with DCOUNT to verify match count 5. Ensure numeric values aren't stored as text in the field column 6. Check that criteria range includes header row and is properly structured
Use structured Table references instead of cell ranges: =DAVERAGE(Table1[#All], "Sales", CriteriaRange) automatically expands with new data. Document your criteria logic clearly.
Example:
Excel doesn't recognize DAVERAGE
Function name misspelled or Excel version too old (pre-Excel 2000, extremely rare).
1. Check spelling: DAVERAGE not D-AVERAGE or DAVERAGE_ 2. Ensure no extra spaces: =DAVERAGE( not = DAVERAGE( 3. Verify function works in your Excel version (should work in Excel 2000+) 4. Try retyping the formula from scratch 5. Check if workbook is in compatibility mode that might affect function availability
Use Excel's autocomplete feature when typing formulas - type =DAV and let Excel suggest DAVERAGE. This ensures correct spelling.
DAVERAGE Pro Tips and Techniques
Use Named Ranges for Maintainability
Instead of =DAVERAGE(A1:D100, "Sales", F1:G2), define named ranges: Name your database range 'SalesData' and criteria range 'FilterCriteria'. Result: =DAVERAGE(SalesData, "Sales", FilterCriteria). Benefits include self-documenting formulas that are easier to understand, simpler range updates without editing formulas, reduced errors from incorrect range references, and named ranges that work across worksheets. Best for reports with multiple DAVERAGE formulas or collaborative workbooks where clarity matters.
Combine OR and AND Logic in Criteria
Create complex filters by combining rows (OR) and columns (AND). For example, to average sales for 'North region with Sales>1000 OR South region with Sales>500', create a criteria range with headers 'Region' and 'Sales', then two rows: Row 1 with 'North' and '>1000', Row 2 with 'South' and '>500'. This powerful technique replicates SQL WHERE clauses in Excel without writing complex nested IFs or array formulas. Performance: Up to 10x faster than equivalent array formula approaches for datasets over 1,000 rows.
Dynamic Field Selection
Make the field parameter dynamic using INDIRECT or CHOOSE: =DAVERAGE(SalesData, INDIRECT(H1), FilterCriteria), where H1 contains 'Sales', 'Units', or other field names. This creates one formula that can average different columns based on user selection. Use case: Executive dashboards where users select which metric to analyze via dropdown. Combine with data validation lists for a fully interactive experience. Add error handling: =IFERROR(DAVERAGE(SalesData, INDIRECT(H1), FilterCriteria), 'Invalid field').
Performance Optimization for Large Datasets
DAVERAGE performance degrades with datasets over 50,000 rows. For better performance: 1) Limit database range to only necessary columns (exclude unused fields), 2) Use Excel Tables for automatic range management, 3) Consider SUMPRODUCT/COUNTIF combination for faster calculation: =SUMPRODUCT(...)/COUNTIF(...), 4) Use Power Query or Pivot Tables for datasets over 100,000 rows. Benchmark: DAVERAGE handles 10,000 rows in ~0.5 seconds but slows to 5+ seconds at 100,000 rows. AVERAGEIFS alternative processes same data in 1-2 seconds.
Wildcard Criteria for Partial Matches
Use wildcards in criteria for flexible text matching: '*' matches any number of characters (e.g., 'Jo*' matches John, Jones, Joseph), '?' matches single character (e.g., 'Jo?n' matches John but not Joan). Combine them: '?o*son' matches Robertson, Johnson, Dobson. Example criteria: Set Product criteria to 'Widget*' to average all products starting with 'Widget' (Widget A, Widget Pro, Widget XL, etc.). Limitation: Wildcards only work with text criteria, not numeric comparisons. Very useful for product families, partial name matching, and flexible filtering.
Build Complete Database Analysis
Use DAVERAGE alongside related functions for complete analysis: DSUM for totals, DCOUNT for record counts, DMAX/DMIN for ranges, DGET for single values. They all share the same database and criteria ranges, creating a consistent analytical framework. Example: Total Sales (DSUM), Transaction Count (DCOUNT), Average Sale (DAVERAGE), Highest Sale (DMAX), Lowest Sale (DMIN) - all using the same criteria range. Change the criteria once, and all metrics update automatically. This is especially powerful in financial modeling and reporting dashboards.
Need Help with DAVERAGE 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 SUMIF function with practical examples and error solutions. Learn how to sum cells based on criteria with step-by-step tutorials.
Master DCOUNTA to count non-empty cells in databases with multiple criteria. Learn syntax, examples, and solutions for Excel and Google Sheets.
The DGET function extracts a single value from a database table that matches specific criteria. Master DGET for precise data retrieval in Excel.