What is the DGET function?
=DGET(database, field, criteria)DGET finds the one record in a list (database) that meets a criteria table and returns the value of the field (column) you choose. Its conditions are written as a separate table on the sheet.
Exactly one record must match: none gives #VALUE!, more than one gives #NUM!. F5:F6 holds the condition "Sales >=90000". Also try F1:F2 (Seoul) to see #NUM!.
Arguments
- database
- The whole list. The first row must hold the headers.
- field
- The column to calculate: a column number (the first column is 1), a header name such as "Sales", or a cell holding the header (D1).
- criteria
- The criteria table. Its first row uses the same headers as the database, with the conditions below.
DGET examples
Example 1. Basic use
=DGET(A1:D9, 2, F5:F6)Only row 7 has sales of 90000 or more, so its product, "Milk", is returned.
Example 2. Field by name
=DGET(A1:D9, "Branch", F5:F6)The branch of the same record: "Seoul".
Example 3. When several match
=DGET(A1:D9, 2, F1:F2)There are 3 Seoul records, so #NUM!.
Common mistakes
Criteria that match several records
DGET returns one value only. Add conditions on the same row (AND) to narrow it to one record.
Leaving the header out of the criteria range
The first row of the criteria range must be a header. Without it, the first condition is read as the header.
FAQ
- Can it return a non-numeric field?
- Yes. DGET returns text fields as they are.
- How is it different from VLOOKUP?
- You can apply several conditions through the criteria table, and it tells you with an error when more than one value matches.