How to Use the DGET Function in Excel
Today, we’re going to delve into the specifics of the DGET function, an essential tool found in both Microsoft Excel and Google Sheets. This function is designed to extract a single value from a tabulated database based on specific criteria. Let’s explore how it functions in these spreadsheet applications.
Basic Syntax
The basic syntax for the DGET function is as follows:
=DGET(database, field, criteria)
- database: The range of cells that represents your database. This consists of rows called records, each containing related data, and columns known as fields.
- field: This is the column number from which to retrieve data. Columns are indexed starting from 1, so the first column is number 1, the second number 2, and so on.
- criteria: This is a range that defines the criteria. DGET will return a value from the specified field only if the entries in the database match the conditions laid out in this range.
Example Task
Consider a database containing students’ scores across various subjects. We aim to use the DGET function to find the score of a student named “Alice” in “Mathematics”.
Example in Excel
Suppose our database is located in cells A1 to C6, with student names in column A, subjects in column B, and scores in column C. Our criteria are set in the range F1 to G2, with “Student Name” in F1, “Alice” in F2, “Subject” in G1, and “Mathematics” in G2.
Student Name | Subject | Score |
---|---|---|
Alice | Mathematics | 85 |
Bob | Mathematics | 78 |
Alice | English | 92 |
Bob | English | 88 |
The DGET formula to fetch Alice’s mathematics score then would be:
=DGET(A1:C6, "Score", F1:G2)
This formula returns the value 85, representing Alice’s score in Mathematics.
Example in Google Sheets
The approach in Google Sheets mirrors that of Excel. Utilizing the same data and criteria setup allows for seamless functionality across both platforms.
The DGET formula in Google Sheets is:
=DGET(A1:C6, "Score", F1:G2)
As in Excel, this will return 85, the score of Alice in Mathematics.
Utilizing the DGET function, you can efficiently pull specific data from a database based on defined criteria in both Microsoft Excel and Google Sheets.
More information: https://support.microsoft.com/en-us/office/dget-function-455568bf-4eef-45f7-90f0-ec250d00892e