How to Use Excel Database Functions DGET, DAVERAGE, & DMAX

There are twelve database functions available in Excel: DAVERAGE, DCOUNT, DCOUNTA, DGET, DMAX, DMIN, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DVAR, and DVARP.

All the database functions are structured in the same way in terms of input arguments:

The DSUM function has the following arguments

=DSUM (database, field, criteria)

  • The database is the entire range of cells that makes up the database.
  • The field is the column used in the function.
  • The criteria are the cells that specify the conditions one wants to apply.

Introduction

In our example, a hypothetical tennis coach running a tennis clinic franchise is evaluating the performance of the players, who come to the clinic franchises, on the different court surfaces. Database functions can query the data according to certain criteria. A picture of the source data is shown below.

Excel Database of Tennis Players

How to Use Excel Database Functions

Example 1 – Use the DGET Excel Database Function

  • Make a copy of the original data since it’s always best to keep a version of the source data intact. We want to see the name of the player, whose PlayerID is #1077. We can use the DGET function to retrieve this value.
  • Copy the field names of the database to Row 2. It is very important that they are exactly the same since this will form part of our criteria.

DGET Excel Function, Tennis Player Database

  • Enter the value #1077 in Cell A3, as shown.

DGET function pulls data from Excel Database

Read More: VLOOKUP versus INDEX and MATCH versus DGET

  • In Cell H5, enter the following formula:

=DGET ($A$6: $E$106, “Player Name”, $A$2: $E$3)

Excel DGET Function Syntax

The database refers to the entire range of data from $A$6:$E$106, field refers to the column containing the value which one wants to retrieve data from, and criteria forms the basis of the retrieval. We want to retrieve the name of the player whose PlayerID is #1077, this follows a similar logic to a SQL query.

Read More: Create Database in Excel in 8 Easy Steps

  • Press Ctrl + Enter, and Alyssa James is returned since she is the player whose PlayerID is #1077. This is also similar to the way one uses a VLOOKUP or HLOOKUP function to look up a value in another column, based on an input value in a different column.

Output of using DGET function in a database (Excel database functions)

Example 2 – Excel DAVERAGE Function

  • Make a copy of the original data since it’s always best to keep a version of the source data intact. We want to find out what the average age of the female players who attend the clinics, is.
  • On a new sheet, copy the field names of the database to Row 2, in order to ensure that they are exactly the same.

DAVERAGE Function in Excel

  • Enter the value Female in Cell C3, as shown.

DAVERAGE Function Output

  • In Cell H6, enter the following formula:

=DAVERAGE ($A$6: $E$106, “Age”, $A$2: $E$3)

Using DAVERAGE Function in an Excel Database

  • Press Ctrl + Enter. You’ll get 21.55 as the average age.

Output of DAVERAGE function in Excel

Example 3 – DMAX Database Function

  • Make a copy of the original data. We want to see the oldest male playing on hard courts, attending the clinics. The database functions can accept multiple criteria, so this is not an issue to compute.
  • On the new sheet, copy the field names of the database to Row 2, in order to ensure that they are exactly the same.

DMAX Function in Excel

  • Enter the values Male in Cell C3 and Hard Court in E3 as shown.

DMAX Function showing output

  • In Cell H6, enter the following formula:

=DMAX ($A$6: $E$106, “Age”, $A$2: $E$3)

Excel DMAX Function Syntax

  • Press Ctrl + Enter.

Excel DMAX Function Output

Related Readings

Download the Working File

Database-Functions-Tutorial


<< Go Back to Excel Function Categories | Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Taryn Nefdt
Taryn Nefdt

Taryn is a Microsoft Certified Professional, who has used Office Applications such as Excel and Access extensively, in her interdisciplinary academic career and work experience. She has a background in biochemistry, Geographical Information Systems (GIS), and biofuels. She enjoys showcasing the functionality of Excel in various disciplines. She has over ten years of experience using Excel and Access to create advanced integrated solutions.

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo