Category: FUNCTION | Updated: 2026-11-22
How to Use the DGET Function in Google Sheets | Extract a Single Matching Value from a Database
Syntax
=DGET(database, field, criteria)
- database: Specifies the entire cell range of the data, including headers in the first row.
- field: Specifies the header name of the column whose value you want to retrieve, or its column number from the left.
- criteria: Specifies the cell range containing the filter conditions (headers + condition values).
Practical Example with a Table
Here is an example of retrieving the department of an employee whose “Employee ID is S002” (specified in criteria range E1:E2) from an employee master table (A1:C5).
| Cell Range | Role | Contents |
|---|---|---|
A1:C5 |
Database | Row 1: Employee ID, Name, Department / Rows 2–5: employee records |
E1:E2 |
Criteria Range | E1 = Employee ID, E2 = S002 |
| Formula Cell | Extracted Result | =DGET(A1:C5, "Department", E1:E2) → Outputs the department name for Employee ID “S002” |
Common Errors and Notes
- #NUM! Error: Occurs when 2 or more records match the criteria. Specify a unique key with no duplicates in your search criteria.
- #VALUE! Error: Occurs when 0 records match the criteria, or when the
fieldheader name is incorrect. - Multiple Matches from Prefix Matching: Because text criteria default to prefix matching, writing
S1can also matchS10orS11and trigger a#NUM!error. To force an exact match, write="=S1".
Frequently Asked Questions
Q. What is the main difference between the DGET function and the VLOOKUP function?
A. VLOOKUP requires the lookup value to be in the leftmost column of the table, whereas DGET can search by criteria in any column and directly extract a single record using multi-column AND conditions.
Q. What happens if two or more records match the criteria?
A. Because DGET is designed to extract "one unique record," a "#NUM!" error is returned if multiple records match the criteria.