Database
All versions
◉ 35 views
=DGET()
Extracts a single value from a column of a list or database that matches conditions that you specify.
Applies To:
Excel for Microsoft 365Excel for Microsoft 365 for MacExcel 2024Excel 2024 for MacExcel 2021Excel 2021 for MacExcel 2019Excel 2016
=DGET(database, field, criteria)
Hover argument names in the table for details.
Output typeMixed
Popularity30 / 100
VolatileNo
Dynamic ArrayNo
Download sample .xlsx ▦ Try in Playground
Dedicated file for this function — safe & lightweight · sample data + live formulas
⬇ Download Sample Workbook
A dedicated .xlsx for =DGET() with Persian sample data & live formulas — open in Excel and practice.
- Sheet “Sample” — data table + formula in place
- Sheet “Guide” — syntax, arguments & tips from this page
- Instant & secure (token + rate limit)
Quiz this function
%d questions — syntax, example & errors — test yourself!
◧ Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
database |
Range | Required | The range of cells that makes up the list or database. A database is a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column. |
field |
Any type | Required | Indicates which column is used in the function. Enter the column label enclosed between double quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the position of the column within the list: 1 for the first column, 2 for the second column, and so on. |
criteria |
Range | Required | The range of cells that contains the conditions that you specify. You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label in which you specify a condition for the column. |
▣ Examples
▦ Data
| Cell | Value |
|---|---|
A2 |
Tree |
B2 |
Height |
C2 |
Age |
D2 |
Yield |
E2 |
Profit |
F2 |
Height |
A3 |
="=Apple" |
B3 |
>10 |
F3 |
<16 |
A4 |
="Pear" |
B4 |
>12 |
A5 |
Tree |
B5 |
Height |
C5 |
Age |
D5 |
Yield |
E5 |
Profit |
A6 |
Apple |
B6 |
18 |
C6 |
20 |
D6 |
14 |
E6 |
$105 |
A7 |
Pear |
B7 |
12 |
C7 |
12 |
D7 |
10 |
E7 |
$96 |
A8 |
Cherry |
B8 |
13 |
C8 |
14 |
D8 |
9 |
E8 |
$105 |
A9 |
Apple |
B9 |
14 |
C9 |
15 |
D9 |
10 |
E9 |
$75 |
A10 |
Pear |
B10 |
9 |
C10 |
8 |
D10 |
8 |
E10 |
$77 |
A11 |
Apple |
B11 |
8 |
C11 |
9 |
D11 |
6 |
E11 |
$45 |
A12 |
Tree |
B12 |
Height |
C12 |
Age |
D12 |
Yield |
E12 |
Profit |
F12 |
Height |
A13 |
="=Apple" |
B13 |
>10 |
F13 |
<16 |
A14 |
="Pear" |
B14 |
>12 |
A15 |
Tree |
B15 |
Height |
C15 |
Age |
D15 |
Yield |
E15 |
Profit |
A16 |
Apple |
B16 |
18 |
C16 |
20 |
D16 |
14 |
E16 |
$105 |
A17 |
Pear |
B17 |
12 |
C17 |
12 |
D17 |
10 |
E17 |
$96 |
A18 |
Cherry |
B18 |
13 |
C18 |
14 |
D18 |
9 |
E18 |
$105 |
A19 |
Apple |
B19 |
14 |
C19 |
15 |
D19 |
10 |
E19 |
$75 |
A20 |
Pear |
B20 |
9 |
C20 |
8 |
D20 |
8 |
E20 |
$77 |
A21 |
Apple |
B21 |
8 |
C21 |
9 |
D21 |
6 |
E21 |
$45 |
Returns the #NUM! error value because more than one record meets the criteria (any apple or pear tree).
=DGET(A4:E10, "Yield", A1:A3)
Result:
#NUM!
Returns 10 (the yield of the apple tree in row 9) because that is the only record that meets the conditions in A1:F3.
=DGET(A4:E10, "Yield", A1:F3)
Result:
10
§ Remarks
- If no record matches the criteria, DGET returns the #VALUE! error value.
- If more than one record matches the criteria, DGET returns the #NUM! error value.
- You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount $10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
- Although the criteria range can be located anywhere on the worksheet, do not place the criteria range below the list. If you add more information to the list, the new information is added to the first row below the list. If the row below the list is not blank, Microsoft Excel cannot add the new information.
- Make sure that the criteria range does not overlap the list.
- To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.
✦ Tips
- You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell below the column label for specifying the condition. For example, if the range G1:G2 contains the column label Income in G1 and the amount $10,000 in G2, you could define the range as MatchIncome and use that name as the criteria argument in the database functions.
- Although the criteria range can be located anywhere on the worksheet, do not place the criteria range below the list. If you add more information to the list, the new information is added to the first row below the list. If the row below the list is not blank, Microsoft Excel cannot add the new information.
- Make sure that the criteria range does not overlap the list.
- To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.
⚠ Common Errors
#VALUE!
If no record matches the criteria, DGET returns the #VALUE! error value.
Fix: Check the criteria values and the criteria range headers
#NUM!
If more than one record matches the criteria, DGET returns the #NUM! error value.
Fix: شرطها را دقیقتر کنید تا فقط یک رکورد باقی بماند، یا از تابع دیگری مانند DFILTER/DSUM استفاده کنید.
💬 Comments & Q&A 0 approved
🔒 Your comment will be published after review.Share your thoughts — visible after admin approval
No comments yet — be the first!