Excel functions / Database

DGET function

The one value in a column of a table from the single row that meets the conditions. Two matching rows are an error, which makes it a strict lookup.

Syntax

=DGET(database, field, criteria)

Arguments

When to use it

DGET reads a single value from a table: the one in the row that meets the conditions written in a criteria range. It is a lookup that insists on exactly one match.

That strictness is the point. Where VLOOKUP quietly returns the first of two matches, DGET stops with an error, which is how you find out that a code is in the list twice.

Examples

  1. The price of one product

    ABCDE
    1Code
    2P-1021.2
    3
    4CodeProductPrice
    5P-101Notebook3.5
    6P-102Pen1.2
    7P-103Stapler8.9
    8P-103Stapler (old)7.5

    In E2: =DGET(A4:C8, "Price", A1:A2) → 1.2

    Try this example

  2. A code that is there twice

    ABCDE
    1Code
    2P-103#NUM!
    3
    4CodeProductPrice
    5P-101Notebook3.5
    6P-102Pen1.2
    7P-103Stapler8.9
    8P-103Stapler (old)7.5

    In E2: =DGET(A4:C8, "Price", A1:A2) → #NUM!

    Two rows have the code P-103. DGET refuses to choose.

    Try this example

  3. A code that is not there

    ABCDE
    1Code
    2P-999#VALUE!
    3
    4CodeProductPrice
    5P-101Notebook3.5
    6P-102Pen1.2
    7P-103Stapler8.9
    8P-103Stapler (old)7.5

    In E2: =DGET(A4:C8, "Price", A1:A2) → #VALUE!

    Try this example

Common mistakes

DGET in other languages

Excel shows function names in its own language. In these languages it also puts a semicolon between arguments where English has a comma.

Translate a whole formula

Try DGET in the playground

Related functions