DGET function
Extraction — from a database a single record that matches the specified criteria.
Database · Guided Excel example
Where can you use it?
Teams working with structured records. When summarising matching records in a headed Excel list, match the criteria header to the source header.
Scenario in the workbook
Return one matching record. The formula returns an error if the criterion matches multiple records.
A worked example from the workbook
| Row | A | B | C |
|---|---|---|---|
| 6 | Group | Amount | Criteria blocks |
| 7 | A | 7 | Group |
| 8 | B | 14 | A |
| 9 | C | 21 | Group |
| 10 | — | — | B |
| 11 | — | — | Group |
| 12 | — | — | C |
=DGET($A$6:$B$9,"Amount",$C$7:$C$8)Illustrative output7
See the inputs and instructions for all 3 examplesWorked examples
Return one matching record. The formula returns an error if the criterion matches multiple records.
Column F provides expressions as text. Satisfy the stated requirements, then paste into an empty Excel cell and compare with column G. The result was not verified in desktop Excel here.
| Row | A | B | C |
|---|---|---|---|
| 6 | Group | Amount | Criteria blocks |
| 7 | A | 7 | Group |
| 8 | B | 14 | A |
| 9 | C | 21 | Group |
| 10 | — | — | B |
| 11 | — | — | Group |
| 12 | — | — | C |
| Trial | Expression | Sample output |
|---|---|---|
| Record 1 | =DGET($A$6:$B$9,"Amount",$C$7:$C$8) |
7 |
| Record 2 | =DGET($A$6:$B$9,"Amount",$C$9:$C$10) |
14 |
| Record 3 | =DGET($A$6:$B$9,"Amount",$C$11:$C$12) |
21 |
If the result is missing
Multiple matches can produce #NUM!. Check the criteria header and select a unique record.