The DGET function in Microsoft Excel is a powerful tool for extracting specific data from a large dataset based on specified criteria. Let’s dive into how it works and explore some examples:
Syntax:
DGET(database, field, criteria)
database
: The range of cells that make up the list or database.field
: Indicates which column you want to retrieve data from (use column labels or numeric positions).criteria
: The range of cells containing the conditions you specify.
Example 1: Using DGET with One Criterion:
- Suppose we have a dataset with cloth items, sizes, colors, and prices. We want to find the price of the item “Shirt.”
- Formula:
=DGET($B$4:$E$9, "Price", $B$11:$B$12)
- Result: The price of the “Shirt” item.
Example 2: Using DGET with OR Criteria:
- If you’re unsure of the product name but know it’s either “T-Shirt” or “Polo T-Shirt,” you can search for both simultaneously.
- Formula:
=DGET($B$4:$E$9, "Price", $B$11:$B$13)
- Result: The price of the matched item (“T-Shirt” in this case).
Example 3: Using DGET with Multiple Criteria:
- Modify the dataset to have two “Shirt” items with different criteria (e.g., colors).
- Search for the blue color among the “Shirt” items.
- Formula:
=DGET($B$4:$E$10, "Price", $B$12:$C$13)
- Result: The price of the blue “Shirt.”
Remember:
- If no record matches the criteria, DGET returns the
#VALUE!
error value. - If more than one record matches the criteria, it returns the
#NUM!
error value.
Feel free to try these examples in your Excel worksheet!
No comments:
Post a Comment