Database function

DGET function

Returns a single value from a column of a list for the one record that matches the criteria. Errors if none or several records match.

Available in All versions of Excel, including Microsoft 365 and Excel for the web

In every Excel versionWorks in Google Sheets

Syntax

DGET(database, field, criteria)
ArgumentWhat it means
databaseRequiredThe list including headers.
fieldRequiredThe column to return a value from, as a header in quotes or a column number.
criteriaRequiredThe criteria range that should identify exactly one record.

Returns: The value of field from the single matching record.

How DGET works

DGET is a lookup built from database criteria. Instead of searching one column for one value as VLOOKUP does, it uses a criteria range, so you can identify a record by several columns at once — for example the stock of the item called "Mouse" from supplier "Clicko" — and return any field of it.

Its strictness is also its main feature: if no record matches you get #VALUE!, and if more than one record matches you get #NUM!. That makes DGET a good guard against ambiguous data: when a key you believed was unique turns out to be duplicated, the error tells you, where VLOOKUP would quietly return the first match.

Examples

1Stock for one item

F2fx=DGET(A1:D7, "Stock", A9:A10)
ABCDEF
1ItemCategoryStockSupplier
2HDMI cableCables120Volt45
3USB-C cableCablesn/aVolt
4MouseInput45Clicko
5KeyboardInput0Clicko
6Ethernet cableCables80NetPro
7WebcamVideo15Lumo
8
9Item
10Mouse

Result: 45

Exactly one record has the item Mouse, so DGET returns its stock, 45.

2Several matches give #NUM!

F2fx=DGET(A1:D7, "Stock", A9:A10)
ABCDEF
1ItemCategoryStockSupplier
2HDMI cableCables120Volt#NUM!
3USB-C cableCablesn/aVolt
4MouseInput45Clicko
5KeyboardInput0Clicko
6Ethernet cableCables80NetPro
7WebcamVideo15Lumo
8
9Category
10Cables

Result: #NUM!

Three records are in the Cables category, so DGET cannot decide which stock to return and shows #NUM!. Add a second condition (e.g. Item) to narrow it to one.

3No match gives #VALUE!

F2fx=DGET(A1:D7, "Supplier", A9:A10)
ABCDEF
1ItemCategoryStockSupplier
2HDMI cableCables120Volt#VALUE!
3USB-C cableCablesn/aVolt
4MouseInput45Clicko
5KeyboardInput0Clicko
6Ethernet cableCables80NetPro
7WebcamVideo15Lumo
8
9Item
10Printer

Result: #VALUE!

There is no item starting with Printer, so DGET returns #VALUE!.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 16 KB

Common errors and how to fix them

ErrorWhy it happensFix
#VALUE!No record matches the criteria (or the field name is wrong).Check the criteria; wrap in IFERROR for a friendly message.
#NUM!More than one record matches.Add conditions until exactly one record matches, or use ="=Mouse" for an exact text match.

Tips

  • Text criteria match values that begin with the text: Mouse would also match Mouse pad and trigger #NUM!. Type ="=Mouse" in the criteria cell for an exact match.
  • In Microsoft 365, XLOOKUP or FILTER with several conditions are more common alternatives, but they do not warn you about duplicates the way DGET does.

Google Sheets

DGET also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

DGET in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechDZÍSKAT
DanishDHENT
DutchDBLEZEN
FinnishTNOUDA
FrenchBDLIRE
GermanDBAUSZUG
HungarianAB.MEZŐ
ItalianDB.VALORI
Norwegian (Bokmål)DHENT
PolishBD.POLE
Portuguese (Brazil)BDEXTRAIR
Portuguese (Portugal)BDOBTER
RussianБИЗВЛЕЧЬ
SpanishBDEXTRAER
SwedishDHÄMTA
TurkishVAL