The DGET function is one of the Excel database functions. This group of functions summarizes information from large data tables and returns specific information based on one or more criteria. Use the DGET function to return a single data field that matches the conditions you specify.
The instructions in this article apply to Excel 2019, 2016, 2013, 2010, 2007; Excel for Office 365, Excel Online, Excel for Mac, Excel for iPad, Excel for iPhone, and Excel for Android.
- DGET Syntax and Arguments
- Criteria matching DGET
- Select criteria
- Name the database
- Enter the DGET function
DGET Syntax and Arguments
Function syntax is the structure that Excel uses to fulfill your request.
Syntax and arguments for the DGET function:
= DGET ( базы данных , поле , Критерии )
All database functions have the same three arguments:
- Database (necessary). Specifies a range of cell references that contain a database. Field names must be included in the scope.
- Field (necessary). Specifies which column or field the function will use in calculations. Enter an argument by entering a field name or column number.
- criteria (required): A list of cell ranges containing the specified conditions. The range must contain at least one field name from the database and at least one other cell reference that specifies the condition being evaluated by the function.
Criteria matching DGET
The example shown in this tutorial uses the DGET function to determine the number of sales orders placed by a particular sales agent in a given month.
To follow this tutorial, enter the data in the image above into a blank Excel sheet.
To have DGET view data only for a specific seller, enter the agent’s name under the name of the SalesRep field in row 3. In cell E3, enter the criteria Harry.
Name the database
Using a named range for large data ranges, such as a database, makes it easier to pass that argument to a function and avoids errors caused by incorrect range selection.
Named ranges are useful when the same range of cells is often used in calculations or when creating charts or graphs.
Highlight cells D6 † F12 on the sheet to select a range.
Place the cursor in the name field.
A type Sales data STRONG>.
Click Enter to create a named range.
Enter the DGET function
You are now ready to get into the DGET function and create a formula along with the function arguments.
Select cell E 4 † Displays the results of the function.
Select Insert function (the fx symbol to the left of the formula bar) to open the Insert Function dialog box. Excel for Mac opens the Formula Builder.
In the text box, type Search function DGET and select TO GO †
Select function DGET in the list Select a function and select Okay † Except for Excel for Mac where you choose Insert function †
Place the cursor in the Database text box.
Enter Sales dates.
Place the cursor in the Field text box.
Enter #Orders †
Place the cursor in the Criteria text box.
Select cells from D2 before F3 on the worksheet to enter a range.
Select Okay † Extract in Excel for Mac wherever you want Finished †
Answer 217 appears in cell E4.
This is the number of orders made by Harry.
#VALUE errors occur when field names are not included in the database argument. For this lesson, the field names in cells D6 through F6 must be included in the named range SalesData.