Excel function

DGETfunction

Returns the field value of the single record that meets the criteria.

All versions
=DGET(A1:D9, 2, F5:F6)
Range to drag
A
B
C
D
E
F
G
1
2
3
4
5
6
7
8
9

Drag the corner dots to change database, criteria. Click the numbers on the top to change field. Change the criteria range to F1:F2 (Seoul). Three records match, so you get #NUM!. Try breaking it on purpose to see the errors.

Result

Milk

database
A1:D9Drag the corner dots on the table

The whole list. The first row must hold the headers (field names).

field
2database has 4 columns

The column to calculate. The first column of the database is 1. In Excel you can also write a header name such as "Sales" or a cell like D1.

criteria
F5:F6

The criteria table. Its first row holds headers; conditions on the same row must all hold (AND), conditions on different rows are alternatives (OR).

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

  1. 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.

  2. Example 2. Field by name

    =DGET(A1:D9, "Branch", F5:F6)

    The branch of the same record: "Seoul".

  3. Example 3. When several match

    =DGET(A1:D9, 2, F1:F2)

    There are 3 Seoul records, so #NUM!.

Common mistakes

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.