ID EN
#Database

DGET

Excel Functions

Get value from matching record

Syntax

EXCEL
=DGET(database, field, criteria)

Arguments

Parameter Description
database Database range including headers.
field Field name or index to count.
criteria Criteria range including headers.

Return Value

The value in a given field

Details

The Excel DGET function gets a single value from a given field in a record that matches criteria. The database argument is a range of cells that includes field headers, field is the name or index of the field to get a max value from, and criteria is a range of cells with headers that match those in database. Using the example above, you can get the value from the field "Total" in a record where color is "Red" and "Day" is Tue with either of the two formulas below: The DGET function is designed to extract a single value based on matching criteria. When more than one record matches criteria, DGET will throw the #NUM error. The criteria can include a variety of expressions, including some wildcards. The table below shows some examples: Note: it appears support for wildcards is not as extensiv

Examples

Example 1

Using the example above, you can get the value from the field "Total" in a record where color is "Red" and "Day" is Tue with either of the two formula

EXCEL
=DGET(B7:E14,"Total",B4:E5) // field by name
=DGET(B7:E14,4,B4:E5) // field by index

See Also

DCOUNT DCOUNTA DMAX DMIN DAVERAGE