Syntax:
DGET(Database, Field, Criteria)
The DGET function syntax has the following arguments:
-
Database Required: The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.
-
Field Required: Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on.
-
Criteria Required: The range of cells that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column.
Remarks:
-
If no record matches the criteria, DGET returns the #VALUE! error value.
-
If more than one record matches the criteria, DGET returns the #NUM! error value.
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.
Tree | Age | Yield | Profit | Height |
="=Apple" | <16 | |||
="Pear" | ||||
Tree | Age | Yield | Profit | |
Apple | 20 | 14 | $105 | |
Pear | 12 | 10 | $96 | |
Cherry | 14 | 9 | $105 | |
Apple | 15 | 10 | $75 | |
Pear | 8 | 8 | $77 | |
Apple | 9 | 6 | $45 | |
Result:
=DGET(A5:E11, "Yield", A1:A3) - #Num!
=DGET(A5:E11, "Yield", A1:F3) - 10 |
|