DGET Function Examples – Excel & Google Sheets

Written by

Editorial Team

Reviewed by

Steve Rynearson

Last updated on November 6, 2023

This tutorial demonstrates how to use the Excel DGET Function.

DGET Main Function

What is DGET?

DGET is an Excel function in the database group of functions. It works similarly to other lookup functions such as VLOOKUP, XLOOKUP or the combined INDEX MATCH.

The function is pointed to a database (or table) and criteria are specified to return a single value result.

=DGET($B$2:$E$9,H3,G3:G4)

Basic lookup

The year 2019 in the table was returned.

How to use DGET

The DGET function takes three required arguments:

  • Database: This is the range of cells used in the lookup. The first row must contain table headers.
  • Field: This indicates which column is used for the return result. It can be entered as text in quotations, as a cell reference or as a column index i.e. 1 is the first column, 2 is the next, etc.
  • Criteria: This is the range of cells that contains the conditions you specify. There is no limit on the number of conditions, but it must include at least one column label and at least one cell of data below it.

There are some key points to using this function.

DGET – Multiple Matches

  1. Unlike VLOOKUP or INDEXMATCH, it will not return a result if there is more than one match.
    =DGET($B$2:$E$9,"Year",G3:G4)

multiple matches

Alternatively, #VALUE will be returned if no matches were found.

multiple matches 1

DGET – Multiple Criteria

  1. Multiple criteria can be used in the DGET function such as looking for Model and Colour.

multiple cirteria

Adding in cost as criteria, you can use greater than or less than, for example.

numeric logical criteria

DGET – Multiple Rows

  1. The cell containing a DGET function cannot be filled down and will result in a #NUM error (the header of the criteria column will no longer be passed in the argument).

Fill Down

What if the header row is frozen and then the cell is filled down?

fill down with header row locked

The result is a #NUM! error. You must make a new table with headers and the grey Charger criteria to return the expected result. This is a scenario where the other lookup functions are far more flexible than DGET.

DGET – Partial Matches

  1. Lastly, DGET can return results using partial matches.

partial matches

Interested in more lookup functions?

See our other articles on VLOOKUP, HLOOKUP, INDEX MATCH or the new XLOOKUP.

DGET in Google Sheets

The DGET Function works exactly the same in Google Sheets as in Excel:

DGET Google Function

AI Formula Generator

Try for Free

Excel Practice Worksheet

practice excel worksheet

Practice Excel functions and formulas with our 100% free practice worksheets!

  • Automatically Graded Exercises
  • Learn Excel, Inside Excel!

Free Download

Return to List of Excel Functions