The DGET function is used to extract a single value from a database table-like array or range based on a specified criterion.
The DGET function follows this syntax:
DGET(database, field, criteria)
Here's a simple breakdown of the syntax:
database: This is your range of cells that makes up the database. Your database should have a row of labels on top, as DGET uses these labels to identify columns.
field: This indicates which column (by label name or index) from the database you want to retrieve a value from.
criteria: This is a range of cells that specifies the conditions the data must meet to be considered in the DGET function. The criteria range should include at least one column label and a cell below it with a condition for the data.
Below are the steps you can follow to use the DGET function in Google Sheets:
Suppose you have a small database of employees with their ID, Name, and Department in a Google Sheet like this:
Let's say you want to find the name of the employee with ID 2. You'll need to set up a criteria range elsewhere in your sheet like this:
Here, you're telling DGET to look for the record where the ID is 2.
Now, you want to find Mary's department. Your DGET formula will look like this:
=DGET(A2:C5,F2,E2:E3)
Criteria Range Setup: Your criteria range should mimic the structure of your database headers for the fields you're including in the criteria.
Single Record: Ensure your criteria is specific enough to return a single record. DGET will return an error if the criteria match more than one record or no records at all.
Error Handling: If you get an error, double-check your criteria range and ensure you're using the correct labels and data types.
We hope that this article has helped you and given you a better understanding of how to use the DGET function in Google Sheets. If you enjoyed this article, you might also like our articles on how to use PERCENTRANK in Google Sheets and how to create a fillable form in Google Sheets.