How to Dget Function in Excel

Learn multiple Excel methods to dget function with step-by-step examples and practical applications.

excelformulaspreadsheettutorial
13 min read • Last updated: 7/2/2025

How to Dget Function in Excel

Why This Task Matters in Excel

Every day, analysts, accountants, project managers, and operations teams face the same practical challenge: “I have a large list of records—how do I pull out one specific value that matches multiple conditions?” Think of a product catalog, an employee directory, or a sales order register. You may need one unique price, an employee’s hire date, or the exact freight cost for an order that meets several criteria.

DGET (pronounced “dee-get”) is purpose-built for precisely that situation. It belongs to Excel’s family of “Database Functions,” which were introduced long before modern lookup tools such as XLOOKUP and Power Query. Even so, DGET still solves a small but critical slice of everyday problems remarkably well: retrieving one field from a structured table when all specified criteria point to a single, unambiguous record.

In business contexts, this capability shows up everywhere:

  • Inventory control – Return the reorder level for the item whose SKU equals “A-102” and whose supplier equals “Contoso Global.”
  • HR dashboards – Fetch the medical plan for the employee whose ID equals “45578” and whose status equals “Active.”
  • Compliance reporting – Extract the certificate expiration date for the machine whose serial number equals “XZ-88” and whose location equals “Plant 3.”

Excel is well suited to this task because it seamlessly combines a digestible user interface with the ability to hold large tabular datasets and run instant calculations. When users do not know how to isolate a single value accurately, they often copy-paste or apply filters manually—workflows that risk human error, cause version control headaches, and slow down decision-making.

Mastering DGET (alongside alternative lookups) closes that gap. It reinforces core spreadsheet competencies—structured references, logical tests, error handling—and builds a foundation for more advanced skills such as dynamic arrays, Power Query filtering, and database-style thinking. Knowing when and how to deploy DGET can therefore be the difference between a brittle workbook and one that scales confidently across departments and data sizes.

Best Excel Approach

DGET is the most straightforward built-in tool for “single-record, multi-criteria” extraction as long as two conditions are met:

  1. Your data is organized as a classic table—field headers in the first row, records in subsequent rows, no blank columns.
  2. The criteria you supply identify exactly one matching record. (If the criteria match none or more than one record, DGET returns an error, which you can trap with IFERROR.)

Why choose DGET over XLOOKUP, INDEX/MATCH, or FILTER?

  • It is highly readable: the criteria live in visible cells, often forming a mini “criteria range” that anyone can audit.
  • It accepts column labels instead of hard-coded index numbers, reducing maintenance when the table structure changes.
  • It performs an implicit AND test across every criteria column.

However, DGET is less flexible when the result might not be unique or when you expect multiple matches (that is the domain of FILTER or advanced formulas).

Syntax:

=DGET(database, field, criteria)
  • database – The entire table, including headers, e.g., [A1:E5000].
  • field – A single column to return. Accept either the column header enclosed in double quotes (\"Price\") or a numeric index (3).
  • criteria – A separate range containing at least one header row and one criteria row, e.g., [G1:H2].

Alternative approach (modern Excel):

=IFERROR(
    FILTER( database[field] ,
        (database[Header1]=criteria_value1) *
        (database[Header2]=criteria_value2)
    ), 
"Not found")

XLOOKUP combined with CHOOSECOLS is also viable but generally involves longer formulas when multiple criteria are needed.

Parameters and Inputs

  • database (required) – Must be a contiguous rectangular block. Top row must contain unique field names; subsequent rows hold the records. Avoid merged cells inside this range, and ensure no blank column splits the table.
  • field (required) – If you provide a text header, spelling and case must match exactly. Avoid trailing spaces. Numeric indices count from the leftmost column as 1.
  • criteria (required) – Must include at least one header row mirroring database column names. Each additional row beneath is interpreted as AND across the columns but OR between rows.
  • Data preparation – Clean data types: numbers should be stored as numeric, dates as true date serials, text as plain text. Mixed data types can cause unpredictable mismatches.
  • Validation rules – Ensure your criteria fields actually exist in the database. Check for duplicate field names, which will break DGET.
  • Edge cases – Blank cells in the criteria row behave as wildcards (no restriction for that field). If multiple rows meet the criteria, DGET throws #NUM!. If none meet the criteria, it throws #VALUE!. Handle these via IFERROR or IFNA.

Step-by-Step Examples

Example 1: Basic Scenario

Goal: Retrieve the list price of a specific product given its SKU.

Sample data
Place the table below in [A1:C7]:

SKUProduct NameList Price
A-100Widget Mini15.99
A-101Widget Pro22.50
A-102Widget Max27.00
B-200Gizmo Basic18.75
B-201Gizmo Plus25.00
C-300Thing 130.00

Next, set up a small criteria block in [E1:F2]:

SKU
A-101

Steps

  1. Click cell G1 and type “Result.”
  2. In G2 enter:
=DGET([A1:C7], "List Price", [E1:F2])

Press Enter. The formula returns 22.5 because “Widget Pro” is uniquely matched by SKU A-101.

Why it works

  • [A1:C7] provides DGET with the full database.
  • \"List Price\" points DGET to the column third from the left—no need to hard-code 3.
  • [E1:F2] supplies a single criteria row: SKU equals “A-101.”
    Because exactly one record meets the criteria, DGET returns its List Price.

Variations

  • Leaving the F2 cell blank would still work; criteria ranges only need the header in E1 and the match value in E2.
  • Adding a second criteria header under [F1] named “Product Name” with the value “Widget Pro” tightens the AND condition but has the same outcome.

Troubleshooting Tips

  • If you mis-spell \"List Price,\" DGET returns #NAME?.
  • If two records somehow shared the SKU “A-101” (perhaps a data entry error), DGET would return #NUM!, signaling ambiguity.

Example 2: Real-World Application

Scenario: An HR department tracks employee records in a master table. You need to build a quick lookup sheet that retrieves an employee’s hire date when you supply both the Employee ID and Status.

Data setup
In [A1:E15] create headers: Employee ID, Name, Department, Status, Hire Date. Then populate with 10 sample employees, making sure one ID appears twice (one Active, one Terminated) to simulate possible duplicates.

In another sheet or below the table, create the criteria block [G1:H2]:

Employee IDStatus
45578Active

Formula
In I2 enter:

=IFERROR(
    DGET([A1:E15], "Hire Date", [G1:H2]),
    "No unique match")

Walkthrough

  1. The HR user types the ID (45578) and chooses a status from a dropdown (Active or Terminated).
  2. DGET searches the database. Because only one record has both ID 45578 and Status Active, the formula returns, say, 3-Jan-2018.
  3. If the user forgets to specify Status, DGET faces two matching rows (Active, Terminated) and throws #NUM!, which our IFERROR converts to “No unique match.”

Business value
The HR dashboard remains accurate even as the master table grows. Users can see instantly if conflicting status entries exist—an implicit data-quality check.

Integration tips

  • Use Data Validation to present a dropdown list of unique statuses drawn from the master table.
  • Format Hire Date as a custom date (“mmm dd, yyyy”) for consistency.
  • Protect the criteria cells with worksheet protection so casual users do not inadvertently move the headers.

Example 3: Advanced Technique

Challenge: Finance needs to populate an invoice template automatically with freight and tax details, but only if the order meets multiple variables (Order ID, Ship Region, and Shipped Yes/No). The database sits on a dedicated sheet named “Orders” in [A1:I20000], containing 20 000 rows and nine fields.

Preparation

  1. On the invoice sheet, reserve cells B5 (“Order ID”), B6 (“Ship Region”), and B7 (“Shipped Flag”).
  2. Create the criteria range in [Z1:AB2] (far to the right to keep it out of view):
Order IDShip RegionShipped
=B5=B6=B7

Here we reference the user-input cells directly, so criteria update dynamically whenever the invoice changes.

Formula 1 – Freight

=IFERROR(
    DGET(Orders!$A$1:$I$20000, "Freight", $Z$1:$AB$2),
    "Check criteria")

Formula 2 – Tax (same idea, different field):

=IFERROR(
    DGET(Orders!$A$1:$I$20000, "TaxAmt", $Z$1:$AB$2),
    0)

Why this is advanced

  • Dynamic criteria referencing other cells keeps the invoice fully automated.
  • The criteria range contains formulas, not constants, which DGET evaluates at every recalc.
  • Freight and Tax are retrieved in one pass each, avoiding more complex INDEX/ MATCH or FILTER constructs.

Performance considerations
DGET makes a single pass through the data—a negligible cost even with 20 000 rows. Be sure to set calculation mode to Automatic so updates propagate instantly. If the dataset scales to hundreds of thousands of rows, consider converting [A1:I20000] to an Excel Table (Ctrl + T) and using structured names. DGET works fine with Tables as long as you reference the full body range (exclude Totals row).

Error handling
When any criterion is blank, more than one record might qualify. By wrapping DGET in IFERROR you surface a friendly message (“Check criteria”) or default numeric value (0). Pair that with Conditional Formatting that highlights the message cell red to alert the user.

Tips and Best Practices

  1. Keep criteria visible. Place the criteria range near input cells or on a dedicated “Control” sheet. Hidden criteria make troubleshooting harder.
  2. Name your ranges. Use Formulas → Name Manager to call the database dbSales and criteria critLookup, then write =DGET(dbSales, "Revenue", critLookup) for more readable formulas.
  3. Use text headers, not numeric indices. Quoted field names survive column re-ordering, while numeric indexes break silently if the table layout changes.
  4. Trap errors early. Wrap DGET with IFERROR or IFNA for smoother user experience. Distinguish between “no match” (#VALUE!) and “multiple matches” (#NUM!) when relevant.
  5. Convert to Excel Tables. Tables auto-expand as new records arrive, so your DGET formulas always include the latest data without manual range edits.
  6. Document uniqueness assumptions. Add a note indicating which combination of columns is supposed to be unique. Auditors and colleagues will thank you.

Common Mistakes to Avoid

  1. Missing headers in criteria. Forgetting to replicate the exact column label in the criteria range returns #VALUE! because DGET cannot map the criteria value.
  2. Non-unique matches. Users often assume the data is unique; DGET exposes the oversight by returning #NUM!. Verify uniqueness with Conditional Formatting duplicates or by using COUNTIFS.
  3. Extra spaces or different casing. “List Price ” (note the trailing space) is treated as a different header from “List Price.” Cure this with TRIM on headers or by copying header cells directly.
  4. Mixed data types in the key column. Text and numeric IDs in the same column can cause inadvertent non-matches. Convert everything to consistent type using VALUE or TEXT.
  5. Hard-coding criteria directly in the formula. While possible using nested IFs, hard-coding loses transparency. Keep criteria in cells so users can audit and change them without editing formulas.

Alternative Methods

MethodStrengthsWeaknessesIdeal Use
DGETTransparent criteria, simple syntax, fast on single matchRequires unique match, separate criteria range neededDashboards, forms, quick audits
FILTER + INDEXDynamic arrays, returns multiple or single matches, no criteria range neededRequires newer Excel (O365/2021), longer formula, harder to auditData exploration, large multi-result queries
XLOOKUP with CHOOSECOLSIntuitive syntax for single-column lookups, dynamic spillMulti-criteria requires concatenation or nested LOOKUPsSingle key lookups, replacement for VLOOKUP
INDEX/MATCH/MATCHWorks in all Excel versions, flexible, array-friendlyHarder to read, needs Ctrl + Shift + Enter in legacy Excel for array behaviorCross-version compatibility, complex models
Power Query filteringHandles millions of records, refreshable, no formulasRequires refresh, cannot calculate on the fly, separate interfaceETL pipelines, periodic reporting

When your primary need is one unique value and you want the formula visible in the grid, DGET leads the pack. If you anticipate multiple matches or need compatibility with dynamic arrays, FILTER deserves consideration. INDEX/MATCH remains useful where newer functions are unavailable.

FAQ

When should I use this approach?

Deploy DGET whenever you are confident that the intersection of your criteria columns yields exactly one record. Typical scenarios include pulling fees, tax rates, or identification fields into forms where duplicates would indicate data errors.

Can this work across multiple sheets?

Yes. Point database to a range on a source sheet (e.g., Orders!$A$1:$I$20000) and locate your criteria range on the destination sheet. The only caveat is to keep both ranges open in the same workbook; DGET cannot reference closed external workbooks.

What are the limitations?

Primary constraints: (a) criteria must match exactly one record, (b) database cannot contain duplicate field names, (c) no wildcards inside criteria cells unless using LIKE-style operators, (d) DGET cannot operate on closed workbooks.

How do I handle errors?

Wrap your DGET call in IFERROR or IFNA. To distinguish between “no records” and “multiple records,” use:

=IFERROR(
   IF(ISERROR(DGET(...)),
      "No or multiple matches",
      DGET(...)),
"Invalid input")

Alternatively, check COUNTIFS on your criteria to validate uniqueness before calling DGET.

Does this work in older Excel versions?

DGET has existed since Excel 5.0 (mid-1990s), so it works in every modern desktop version, including Excel 2007, 2010, 2013, 2016, 2019, and Microsoft 365, as well as Excel for Mac. The syntax and behavior are unchanged.

What about performance with large datasets?

DGET is lightweight and linear. Even 100 000 rows perform almost instantaneously on modern hardware. Performance issues typically stem from volatile functions or unnecessary recalculations elsewhere. For truly massive data, switch to Power Query or a database.

Conclusion

Mastering DGET empowers you to pull unique, criteria-driven values without complex nested formulas or macros. You can audit and adjust criteria quickly, flag data quality issues automatically, and integrate results seamlessly into invoices, dashboards, and reports. As you deepen your Excel toolkit, understanding when to leverage DGET—and when to switch to FILTER, XLOOKUP, or Power Query—will make your spreadsheets cleaner, faster, and more robust. Experiment with the examples above, incorporate best practices, and soon you’ll retrieve exactly the data you need with confidence and precision.

We use tracking cookies to understand how you use the product and help us improve it. Please accept cookies to help us improve.