How to Daverage Function in Excel

Learn multiple Excel methods to daverage function with step-by-step examples and practical applications.

excelformulaspreadsheettutorial
12 min read • Last updated: 7/2/2025

How to Daverage Function in Excel

Why This Task Matters in Excel

Modern workbooks often store thousands, sometimes millions, of records about sales, staff, inventory, or production. Decision-makers rarely need the overall average of every single record; they need the average of a subset that meets specific rules:

  • What is the average invoice amount for customers in Europe this quarter?
  • How much does the company spend on overtime for employees in the Marketing department?
  • What is the average lead time for orders larger than 10 000 units?

The DAVERAGE function belongs to Excel’s “Database” family (DSUM, DMAX, DCOUNT, etc.). These functions solve a common business need: calculate aggregate statistics on a table only for rows that match multi-column criteria. While modern functions such as AVERAGEIFS or FILTER plus AVERAGE can achieve similar results, DAVERAGE still shines in several situations:

  1. Flexible criteria layout – criteria live in easily editable cells, so non-technical colleagues can change the rules without touching the formula.
  2. Expandable tables – when the data grows downwards or rightwards, DAVERAGE automatically adjusts.
  3. Complex logic – you can combine “AND” and “OR” across many columns simply by adding extra rows to the criteria range.

Industries from finance to logistics still rely on DAVERAGE inside long-lived workbooks where the function’s transparency outweighs the appeal of newer formulas.
Not knowing DAVERAGE forces analysts to use cumbersome helper columns or manual filtering, leading to version errors, inconsistent reporting, and wasted hours. Mastering it links directly to other core Excel skills—structured references, dynamic named ranges, data validation, and report automation—making your spreadsheets more robust and future-proof.

Best Excel Approach

The most effective way to “daverage” (derive an average from a filtered database) is to use the DAVERAGE function on a properly structured Excel Table or a classic range organised in columnar form with a single header row.

Syntax and logic:

=DAVERAGE(database, field, criteria)
  • database – the entire data block including headers, e.g. [A1:G5000].
  • field – the column to average. It can be a number representing the column index in the database or a text string matching a header label.
  • criteria – the separate criteria block, at minimum two rows tall: header(s) on the first row, condition(s) on the next.

Why this approach is best:

  • Criteria are visible, editable, and can hold formulas themselves.
  • You automatically get “AND” logic across columns in the same row and “OR” logic across multiple rows.
  • The function recalculates instantly when either data or criteria change, supporting interactive dashboards.

When to prefer alternatives:

  • If you need partial text matches with wildcard support across several columns, AVERAGEIFS can be simpler.
  • If your licences include Excel 365, combining FILTER with AVERAGE makes spill-array dashboards cleaner.
  • However, for workbooks shared with users on older versions, DAVERAGE maintains excellent backward compatibility.

Parameters and Inputs

To avoid mis-fires, ensure:

  • database is a contiguous block with one header row only. Blank header cells break the function.
  • All data under each header should be of consistent type (numbers in numeric columns, dates in date columns). Mixed types create #DIV/0! when no rows match the numeric filter.
  • field accepts either an integer (1 for the first column, 2 for the second…) or the exact header text typed inside double quotes. Using the header text keeps formulas readable: "Amount" not 7.
  • criteria must replicate identical header names as those in database. Extra spaces or mismatched capitalisation make Excel treat them as different fields.
  • Criteria cells can include: – Relational operators such as >1000 or <=31-Dec-2024
    – Wildcards * and ? for text patterns
    – Formulas that return a value (e.g. =TODAY()-30 to average the last 30 days)

Validation rules:

  • Do not put more than one condition in the same data cell; stack criteria vertically for OR logic or horizontally for AND logic.
  • If the average would normally divide by zero (no rows meet the rules), DAVERAGE returns #DIV/0!. Wrap it in IFERROR for a friendlier output.

Edge cases:

  • Hidden rows are still considered; to respect manual filters instead, use SUBTOTAL with the AVERAGE function.
  • If you convert the range to an Excel Table, you must reference the Table headers exactly in the criteria range.

Step-by-Step Examples

Example 1: Basic Scenario

Imagine a simple sales ledger:

ABCD
DateRegionSales RepRevenue
01-Jan-2024NorthAlice18 500
03-Jan-2024SouthBob12 300
04-Jan-2024NorthCarla9 700
06-Jan-2024WestAlice14 200
07-Jan-2024NorthBob21 000

Goal: average revenue for the North region.

  1. Place your criteria block a few rows below:
F1:  Region
F2:  North
  1. Enter the DAVERAGE formula:
=DAVERAGE([A1:D6],"Revenue",[F1:F2])

Result: 16 400 (the mean of 18 500, 9 700, and 21 000).

Why it works:

  • The header “Region” in [F1] matches the “Region” header in the database.
  • Criteria in [F2] filters rows to North only.
  • The function then averages the “Revenue” field for those rows.

Common variations:

  • Change [F2] to =E2 where [E2] holds a dropdown of region names. DAVERAGE becomes an interactive lookup.
  • Add another criteria header in [G1] “Sales Rep” with “Alice” in [G2] to average North region sales by Alice only.

Troubleshooting:

  • If you type “Revenue ” with a trailing space in [F1], the function returns #DIV/0! because the header no longer matches. Trim spaces or use the column index 4 instead.

Example 2: Real-World Application

Scenario: An HR department tracks overtime:

ABCDE
EmployeeDepartmentWeek EndingHoursCost
JohnsonMarketing05-Jan-20246210
LeeIT05-Jan-20248280
AhmedMarketing12-Jan-20247245
WanFinance12-Jan-20244140
NelsonMarketing19-Jan-20249315
LeeIT19-Jan-20246210

Goal: average overtime hours for Marketing employees in January only.

  1. Criteria setup (cells H1:I2):
H1: Department   I1: Week Ending
H2: Marketing     I2: >=01-Jan-2024
                  I3: <=31-Jan-2024

Since date criteria are two separate conditions, we need two rows combining Department with each Week Ending rule:

H2: Marketing   I2: >=01-Jan-2024
H3: Marketing   I3: <=31-Jan-2024

This structure achieves “Department is Marketing AND Week Ending on or after 1 Jan 2024 AND Week Ending on or before 31 Jan 2024”.

  1. Formula:
=DAVERAGE([A1:E7],"Hours",[H1:I3])

Result: 7.33 hours.

Business impact:

  • HR instantly sees typical overtime exposure within a specific month for one department, informing staffing decisions.
  • Users can copy the criteria block to a dashboard sheet and hook it to slicers or data validation lists for self-service analytics.

Integration tips:

  • Convert the data range to an Excel Table named tblOvertime. The formula then becomes =DAVERAGE(tblOvertime,"Hours",[H1:I3]), automatically expanding when HR logs new weeks.
  • Add conditional formatting to the Hours column to flag records greater than 10 for quick visual scanning.

Performance considerations: On 50 000-row tables, DAVERAGE remains fast because it leverages Excel’s native calculation engine. Make sure Volatile functions such as TODAY inside criteria do not force constant recalculation on shared network drives.

Example 3: Advanced Technique

Complex scenario: Average cycle time for orders that meet either of two sets of rules:

  • Orders from Region “East” with Order Quantity greater than 5 000
  • Orders from Channel “Online” with Priority “High”

Data headers: Date, Region, Channel, Priority, Quantity, CycleTime.

Criteria block layout to achieve mixed OR logic:

KLMN
RegionQuantityChannelPriority
East>5000
OnlineHigh
  1. The first criteria row says: Region = East AND Quantity greater than 5 000.
  2. The second criteria row says: Channel = Online AND Priority = High.
  3. DAVERAGE combines these rows with OR, producing the union of the two result sets.

Formula:

=DAVERAGE([A1:F10000],"CycleTime",[K1:N3])

Professional tips:

  • Because greater than and less than signs inside cells can be mis-keyed, lock them with data validation or define them through formulas (=">"&G2).
  • If the criteria range is dynamic (users might add more OR rows), convert [K1:N3] to a table called tblCriteria and reference it in the formula. DAVERAGE automatically stretches to include new rows.

Performance optimisation:

  • Use structured references so Excel only recalculates CycleTime when the dependent columns change.
  • Cache volatile criteria values (NOW, RAND) into helper cells updated by macros, reducing recalculation hits in very large workbooks.

Error handling: Wrap the function to avoid ugly error messages on dashboards:

=IFERROR(DAVERAGE([A1:F10000],"CycleTime",[K1:N100]),"No matching records")

Tips and Best Practices

  1. Keep headers identical – copy the header row of your database directly into the criteria block to avoid typos.
  2. Isolate criteria on a dedicated sheet – prevents accidental deletion and keeps dashboards tidy.
  3. Name your rangesrngDB and rngCrit make formulas self-documenting and flexible.
  4. Use data validation dropdowns for criteria cells so end-users select allowed values only, reducing errors.
  5. Add IFERROR wrappers to handle the inevitable “no match” scenarios gracefully.
  6. Document complex criteria with on-sheet comments or a legend so future maintainers grasp the logic quickly.

Common Mistakes to Avoid

  1. Mismatched headers – even a hidden space causes DAVERAGE to treat the column as non-existent, returning #DIV/0!. Always copy-paste headers.
  2. Blank criteria row – a completely blank row inside the criteria range acts as a wildcard “match everything”, often bloating the average unintentionally. Delete unused blank rows.
  3. Mixed data types – numbers stored as text in the field column lead to partial matches and skewed averages. Apply “General” or “Number” format consistently.
  4. Putting two operators in one cell – writing >100 less than 500 in a single criteria cell does not create a between operator; instead, split into two rows or two columns as demonstrated earlier.
  5. Overlapping ranges – never place the criteria block inside the database area; Excel may include those criteria rows in the database leading to circular references.

Alternative Methods

Different paths to the same goal:

MethodProsConsBest For
DAVERAGEVisible criteria, OR logic easy, backward compatible to Excel 97Criteria must live on sheet, limited to “AND within row/OR across rows” patternShared files, legacy workbooks
AVERAGEIFSSimple syntax inside one cell, no separate criteria blockHarder to edit criteria, only supports AND logic unless you sum multiple formulasQuick one-off calculations
FILTER + AVERAGEDynamic arrays, spill ranges visible, easy chaining with other functionsExcel 365 only, performance dips on massive data, formula becomes longInteractive dashboards, Power BI-style layouts
PivotTablePoint-and-click, Drag fields to calculate averages, no formulasManual refresh, criteria flexibility limited to filters/slicersNon-technical users, summary reports
Power QueryHandles millions of rows, refreshes from databases, merges dataRequires query editor knowledge, cannot recalc instantlyETL pipelines, very large datasets

Migration tips:

  • To replace legacy DAVERAGE with AVERAGEIFS, replicate each criteria row as a separate AVERAGEIFS and wrap them in AVERAGE for OR logic.
  • To modernise a workbook, load the data into Power Query, filter in the UI, and output the result to a pivot table.

FAQ

When should I use this approach?

Use DAVERAGE when you need editable, on-sheet criteria that multiple people can adjust without touching the formula itself, especially when OR logic is required between different rule sets.

Can this work across multiple sheets?

Yes. Place the database on Sheet1, criteria on Sheet2, and put the formula on Sheet3:

=DAVERAGE(Sheet1!A1:G1000,"Amount",Sheet2!A1:C3)

Just ensure that Sheet2 remains visible or protected; Excel must still read the criteria cells.

What are the limitations?

DAVERAGE cannot natively handle wildcard OR logic within the same criteria cell, and it always includes hidden rows. For visual filters that should be respected, switch to SUBTOTAL or AGGREGATE.

How do I handle errors?

Wrap DAVERAGE in IFERROR or IFNA:

=IFERROR(DAVERAGE(rngDB,"Revenue",rngCrit),0)

You can also test first with DCOUNT to see if any rows match before calculating the average.

Does this work in older Excel versions?

Absolutely. DAVERAGE has existed since Excel 5.0. The only caveat is that structured Table references are unavailable prior to Excel 2007; fall back to traditional [A1] style ranges.

What about performance with large datasets?

DAVERAGE is non-volatile and calculates quickly, but recalculation load is linear to database size. Use Excel Tables so the function only includes necessary rows, or filter source data with Power Query first to shorten the range.

Conclusion

Learning DAVERAGE equips you with a flexible, transparent way to calculate conditional averages without complex nested formulas. It bridges the gap between simple functions like AVERAGEIFS and heavy tools such as Power Query, making your workbooks powerful yet maintainable. Practise the techniques above, experiment with dynamic criteria, and combine DAVERAGE with data validation or dashboards. As you master it, you will speed up reporting cycles, reduce errors, and deepen your overall Excel proficiency—setting the stage for advanced analytics and automation down the road.

We use tracking cookies to understand how you use the product and help us improve it. Please accept cookies to help us improve.