Averaging and Extracting With DAVERAGE and DGET
Average matching records and pull a single matching value.
Averaging and Extracting With DAVERAGE and DGET is a free Excel Formulas Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Excel Formulas Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Two More D-Functions
This lesson covers two final database functions:
DAVERAGE- the average of a numeric field for matching records.DGET- pulls a single value from the one row that matches your criteria.
Both reuse the same (database, field, criteria) pattern you already know, so you are mostly learning what they return, not new syntax.
DAVERAGE Syntax
DAVERAGE(database, field, criteria) takes the mean of the field column across rows that match the criteria range.
- database - full table with headers.
- field - a numeric column to average.
- criteria - the matching rules block.
It is like AVERAGEIFS, but reads conditions from cells.
=DAVERAGE(A1:C13, "Amount", E1:E2)A First Average
With sales data in A1:C13 (headers Region, Rep, Amount), put Region in E1 and East in E2.
The formula returns the average Amount across East rows. If East orders are 1200, 800, and 1000, the average is 1000. Switch E2 to West and the average updates automatically.
=DAVERAGE(A1:C13, "Amount", E1:E2)Averaging With Conditions
DAVERAGE accepts the full criteria toolkit. To average only large East orders, build a two-column criteria range: Region and Amount headers, then East and >1000 beneath them.
Same-row conditions are AND, so the function averages amounts from East rows above 1000. Blank fields are ignored - only numeric values feed the average.
=DAVERAGE(A1:C13, "Amount", E1:F2)DAVERAGE With No Matches
Unlike DSUM, which returns 0, DAVERAGE returns a #DIV/0! error when no rows match - because you cannot average zero values.
Guard against it by checking the count first, or wrap it in IFERROR to show a friendly message instead of an error code.
=IFERROR(DAVERAGE(A1:C13,"Amount",E1:E2), "No matching records")Meet DGET
DGET is different: it returns a single value from the field of the one row that matches your criteria.
Use it like a lookup. If you have a unique key - say an Order ID - DGET fetches one field from that exact record. Its power and its danger come from insisting on exactly one match.
=DGET(A1:C13, "Amount", E1:E2)DGET as a Lookup
Suppose your table has unique reps and you want the Amount for rep 'Sara'. Put Rep in E1 and Sara in E2.
DGET finds Sara's single row and returns her Amount. Because it can match on several criteria columns at once, DGET handles multi-key lookups that a plain VLOOKUP cannot.
=DGET(A1:C13, "Amount", E1:E2)DGET's Two Error Cases
DGET is strict about matching exactly one row:
- If no rows match, it returns
#VALUE!. - If more than one row matches, it returns
#NUM!.
These errors are actually useful - they warn you that your key is missing or not unique. Tighten the criteria until exactly one record qualifies.
Multi-Criteria DGET
To guarantee a single match, add more conditions. Want the Amount for Sara in the East region? Use a two-column criteria range: Rep and Region headers, then Sara and East beneath.
The AND logic narrows results to one row, and DGET returns its Amount. This is how DGET acts as a clean multi-key lookup.
=DGET(A1:C13, "Amount", E1:F2)Handling DGET Errors
Because DGET errors on zero or multiple matches, wrap it for a smoother experience. IFERROR turns either error into a readable message.
If you specifically want to flag a duplicate differently from a miss, you can test the count with DCOUNTA first and branch your message accordingly.
=IFERROR(DGET(A1:C13,"Amount",E1:F2), "Not found or not unique")Choosing Between the D-Functions
A quick guide to picking the right tool:
- Need a total of matching rows? Use DSUM.
- Need a count of matching rows? Use DCOUNT or DCOUNTA.
- Need the average of matching rows? Use DAVERAGE.
- Need one value from a single matching row? Use DGET.
All four share one criteria range, so you can build a report that totals, counts, averages, and looks up - all driven by the same set of condition cells.
Quick Check
Your DGET criteria match three rows in the table. What does DGET return?
Recap
You finished the D-function family:
- DAVERAGE averages a numeric field for matching rows; no matches gives
#DIV/0!. - DGET returns one value from exactly one matching row; zero matches gives
#VALUE!and multiple matches gives#NUM!. - Both share the
(database, field, criteria)pattern and the AND/OR criteria-range rules. - Wrap them in IFERROR for clean, professional output.
Together with DSUM and DCOUNT, you can now run full criteria-based reports straight from a structured table.
Frequently asked questions
Is the “Averaging and Extracting With DAVERAGE and DGET” lesson free?
Yes — the full text of “Averaging and Extracting With DAVERAGE and DGET” is free to read here on the web, and the Excel Formulas Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Excel Formulas Academy course, upgrade to CoddyKit PRO.
What will I learn in “Averaging and Extracting With DAVERAGE and DGET”?
Average matching records and pull a single matching value. You practise Excel Formulas Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Excel Formulas Academy?
No prior experience is required. Excel Formulas Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Averaging and Extracting With DAVERAGE and DGET” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Excel Formulas Academy lesson?
Yes. Every Excel Formulas Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Setting Up a Criteria Range
- Summing Records With DSUM
- Counting Records With DCOUNT
- Averaging and Extracting With DAVERAGE and DGET