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)| Argument | What it means | |
|---|---|---|
database | Required | The list including headers. |
field | Required | The column to return a value from, as a header in quotes or a column number. |
criteria | Required | The 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
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Item | Category | Stock | Supplier | ||
| 2 | HDMI cable | Cables | 120 | Volt | 45 | |
| 3 | USB-C cable | Cables | n/a | Volt | ||
| 4 | Mouse | Input | 45 | Clicko | ||
| 5 | Keyboard | Input | 0 | Clicko | ||
| 6 | Ethernet cable | Cables | 80 | NetPro | ||
| 7 | Webcam | Video | 15 | Lumo | ||
| 8 | ||||||
| 9 | Item | |||||
| 10 | Mouse |
Result: 45
Exactly one record has the item Mouse, so DGET returns its stock, 45.
2Several matches give #NUM!
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Item | Category | Stock | Supplier | ||
| 2 | HDMI cable | Cables | 120 | Volt | #NUM! | |
| 3 | USB-C cable | Cables | n/a | Volt | ||
| 4 | Mouse | Input | 45 | Clicko | ||
| 5 | Keyboard | Input | 0 | Clicko | ||
| 6 | Ethernet cable | Cables | 80 | NetPro | ||
| 7 | Webcam | Video | 15 | Lumo | ||
| 8 | ||||||
| 9 | Category | |||||
| 10 | Cables |
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!
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Item | Category | Stock | Supplier | ||
| 2 | HDMI cable | Cables | 120 | Volt | #VALUE! | |
| 3 | USB-C cable | Cables | n/a | Volt | ||
| 4 | Mouse | Input | 45 | Clicko | ||
| 5 | Keyboard | Input | 0 | Clicko | ||
| 6 | Ethernet cable | Cables | 80 | NetPro | ||
| 7 | Webcam | Video | 15 | Lumo | ||
| 8 | ||||||
| 9 | Item | |||||
| 10 | Printer |
Result: #VALUE!
There is no item starting with Printer, so DGET returns #VALUE!.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#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:
Mousewould also matchMouse padand 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.
| Language | Function name |
|---|---|
| Czech | DZÍSKAT |
| Danish | DHENT |
| Dutch | DBLEZEN |
| Finnish | TNOUDA |
| French | BDLIRE |
| German | DBAUSZUG |
| Hungarian | AB.MEZŐ |
| Italian | DB.VALORI |
| Norwegian (Bokmål) | DHENT |
| Polish | BD.POLE |
| Portuguese (Brazil) | BDEXTRAIR |
| Portuguese (Portugal) | BDOBTER |
| Russian | БИЗВЛЕЧЬ |
| Spanish | BDEXTRAER |
| Swedish | DHÄMTA |
| Turkish | VAL |