DGET function

DGET returns a single value from a database/table row matching specified criteria, or an error if multiple rows or no rows match.

=DGET(database, field, criteria)

Generate a DGET formula

Describe what you need. The generator will reach for DGET where DGET is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How DGET reads its arguments
databaserequiredfieldrequiredcriteriarequiredDGET
ArgumentRequiredDescription
databaseRequiredThe table range including headers (first row). All criteria columns and the field column must exist within this range.
fieldRequiredThe column to retrieve from, specified as column number (1 = first column) or column header name as text. Must exist in the database.
criteriaRequiredA range with headers (first row) and values to match. Multiple columns in criteria perform AND logic; only rows matching all criteria columns return results.

Returns

A scalar value (text, number, or date) from the matching database row.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Get salary for a specific employee by name

Employee IDNameDepartmentHire DateSalaryStatus
1001Alice ChenEngineering2020-01-1595000Active
1002Bob MartinezSales2019-03-2275000Active
1003Carol JohnsonFinance2021-06-1085000Active
1004David LeeEngineering2022-02-0178000Active
1005Emma WilsonHR2018-11-0572000Inactive
Name
Carol Johnson
=DGET($A$1:$F$6, "Salary", $A$8:$B$9)

Result: 85000

The criteria range specifies Name = 'Carol Johnson'. DGET finds exactly one matching row (Carol's record) and returns the value from the Salary column: 85000.

2. Get hire date for an employee by ID

Employee IDNameDepartmentHire DateSalaryStatus
1001Alice ChenEngineering2020-01-1595000Active
1002Bob MartinezSales2019-03-2275000Active
1003Carol JohnsonFinance2021-06-1085000Active
1004David LeeEngineering2022-02-0178000Active
1005Emma WilsonHR2018-11-0572000Inactive
Employee ID
1005
=DGET($A$1:$F$6, "Hire Date", $A$11:$B$12)

Result: 2018-11-05

The criteria (Employee ID = 1005) uniquely identifies Emma Wilson's row. DGET retrieves the Hire Date from that row, returning 2018-11-05.

3. Get department for an employee using column number

Employee IDNameDepartmentHire DateSalaryStatus
1001Alice ChenEngineering2020-01-1595000Active
1002Bob MartinezSales2019-03-2275000Active
1003Carol JohnsonFinance2021-06-1085000Active
1004David LeeEngineering2022-02-0178000Active
1005Emma WilsonHR2018-11-0572000Inactive
Employee ID
1001
=DGET($A$1:$F$6, 3, $A$14:$B$15)

Result: Engineering

This formula uses field number 3 (the Department column) instead of naming it. The criteria (Employee ID = 1001) matches Alice Chen, and DGET returns the Department value: Engineering.

Common errors

Which DGET error are you seeing?
DGET returned an error#NUM!
Add additional criteria columns to narrow the results to a single row, or ensure your criteria are specific enough to match exactly one employee.
#VALUE!
Verify the criteria values exist in the database. If using a field name, ensure it exactly matches a column header.
#REF!
Verify both range arguments (database and criteria) point to valid, existing cell ranges. Update references if the underlying data has been reorganized.
ErrorWhy it happensHow to fix it
#NUM!The criteria matches more than one row in the database. DGET can return only a single value, so multiple matches cause this error.Add additional criteria columns to narrow the results to a single row, or ensure your criteria are specific enough to match exactly one employee.
#VALUE!The criteria matches no rows in the database, or the field name/number does not exist in the database columns.Verify the criteria values exist in the database. If using a field name, ensure it exactly matches a column header.
#REF!The database or criteria range reference is invalid, such as when columns or rows are deleted or the range is corrupted.Verify both range arguments (database and criteria) point to valid, existing cell ranges. Update references if the underlying data has been reorganized.

Tips and when to use something else

  • DGET requires exactly one match; if you expect multiple results, use FILTER, VLOOKUP with multiple criteria, or INDEX/MATCH instead.
  • Combine multiple criteria columns in the criteria range to narrow results—each column adds AND logic to filter more specifically.
  • Field can be a column number (1, 2, 3...) or the exact header text; using header text is more readable and resilient to column reordering.
  • DGET supports wildcards in criteria (? for single character, * for multiple), enabling partial text matching on the criteria column.

Frequently asked questions

How is DGET different from VLOOKUP?
VLOOKUP looks up a value in the first column of a range and returns from a specified column to the right. DGET searches any column for matching criteria and returns a different column. DGET also has built-in error handling for multiple matches (#NUM!), while VLOOKUP returns the first match silently.
Can I use DGET with multiple criteria?
Yes. Include multiple columns in the criteria range (with headers), and DGET will match rows where ALL criteria columns match. For example, criteria columns 'Department' and 'Status' would filter for rows matching both conditions.
What happens if my criteria has spaces or is case-sensitive?
DGET criteria matching is typically not case-sensitive. Spaces in criteria values must match exactly—if the database has 'Alice' but your criteria is 'Alice ' (with a trailing space), no match occurs. Use TRIM if criteria values may have extra spaces.
Why do I need to use absolute references ($) in DGET formulas?
Absolute references ($A$1:$F$6) prevent the database and criteria ranges from shifting if you copy the formula to other cells. Without them, the ranges adjust relative to the new position, breaking your formula.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17