The DGET function is one of Excel’s database functions. This group of functions summarizes information from large tables of data by returning specific information based on one or more criteria. Use the DGET function to return a single field of data that matches conditions that you specify.
DGET Syntax and Arguments
A function’s syntax is the structure Excel uses to execute your request.
The instructions in this article apply to Excel 2019, 2016, 2013, 2010, 2007; Excel for Microsoft 365, Excel Online, Excel for Mac, Excel for iPad, Excel for iPhone, and Excel for Android.
The syntax and arguments for the DGET function are:
All database functions have the same three arguments:
- Database (required): Specifies the range of cell references containing the database. The field names must be included in the range.
- Field (required): Indicates which column or field is to be used by the function in its calculations. Enter the argument either by typing the field name or the column number.
- Criteria (required): Lists the range of cells containing the specified conditions. The range must include at least one field name from the database and at least one other cell reference indicating the condition to be evaluated by the function.
Match a Criterion With DGET
The example shown in this tutorial uses the DGET function to find the number of sales orders placed by a specific sales agent for a given month.
To follow along with this tutorial, enter the data shown in the above image into a blank Excel worksheet.
Select the Criteria
To get DGET to only look at data for a specific sales rep, enter the name of an agent under the SalesRep field name in row 3. In cell E3, type the criteria Harry.
Name the Database
Using a named range for large ranges of data such as a database makes it easier to enter this argument into the function and it prevents errors caused by selecting the wrong range.
- Highlight cells D6 to F12 in the worksheet to select the range.
- Place the cursor in the Name Box.
- Type SalesData.
- Press Enter to create the named range.
Enter the DGET Function
Now you’re ready to enter the DGET function and create the formula along with the function arguments.
Named ranges are useful when the same range of cells is frequently used in calculations or when creating charts or graphs.
Highlight cells D6 to F12 in the worksheet to select the range.
Place the cursor in the Name Box.
Type SalesData.
Press Enter to create the named range.
- Select cell E4. This is where the results of the function will display.
- Select Insert Function (the fx symbol located to the left of the Formula Bar) to open the Insert Function dialog box. In Excel for Mac, the Formula Builder opens.
- In the Search for a function text box, enter DGET and select GO.
- Select the DGET function in the Select a function list and select OK. Except in Excel for Mac, where you select Insert Function.
- Place the cursor in the Database text box.
- Enter SalesData.
- Place the cursor in the Field text box.
- Enter #Orders.
- Place the cursor in the Criteria text box.
- Highlight cells D2 to F3 in the worksheet to enter the range.
- Select OK. Excerpt in Excel for Mac, where you select Done.
- The answer 217 appears in cell E4.
- This is the number of sales orders placed by Harry.
Select cell E4. This is where the results of the function will display.
Select Insert Function (the fx symbol located to the left of the Formula Bar) to open the Insert Function dialog box. In Excel for Mac, the Formula Builder opens.
In the Search for a function text box, enter DGET and select GO.
Select the DGET function in the Select a function list and select OK. Except in Excel for Mac, where you select Insert Function.
Place the cursor in the Database text box.
Enter SalesData.
Place the cursor in the Field text box.
Enter #Orders.
Place the cursor in the Criteria text box.
Highlight cells D2 to F3 in the worksheet to enter the range.
Select OK. Excerpt in Excel for Mac, where you select Done.
The answer 217 appears in cell E4.
This is the number of sales orders placed by Harry.
#VALUE errors occur when the field names are not included in the database argument. For this tutorial, the field names in cells D6 to F6 must be included in the named range SalesData.
Get the Latest Tech News Delivered Every Day