📊 Excel DSUM Function
Sum Values in a Database with Custom Criteria
The DSUM function sums values in a column of a table or database based on criteria you specify. It helps perform filtered sums with multiple conditions in a structured database-like dataset, making data analysis and reporting easier and more precise.
=DSUM(database, field, criteria)
| Parameter | Description |
|---|---|
| database | Range including the table with headers |
| field | Column to sum (name in quotes or column number) |
| criteria | Range specifying column headers and conditions for filtering |
Select data range including headers
Choose the column to sum
Provide filter conditions
Result based on criteria
📦 Scenario: Sum Quantity of Apples
You want to sum quantities only for “Apple” rows in your inventory table.
Sample Data:
| Fruit | Quantity |
|---|---|
| Apple | 50 |
| Orange | 30 |
| Apple | 70 |
| Peach | 20 |
| Apple | 100 |
Criteria Table:
| Fruit |
|---|
| Apple |
Formula:
Issues:
- Less intuitive for database-style criteria
- Cannot handle OR criteria easily
- Must write conditions inside formula
Benefits:
- Uses criteria table for AND/OR filtering
- Well suited for structured database ranges
- Criteria easily updated without changing formula
Ensure database and criteria headers match exactly to avoid errors.
DSUM supports wildcards like “*” and “?” in criteria for partial matches.
Multiple rows in criteria = OR logic; multiple columns = AND logic.
Use quotes for the field argument for clarity and readability.
- DSUM performs conditional sums based on criteria tables.
- Best for database-like structured data and multi-condition filters.
- More flexible than SUMIFS for complex AND/OR logic.
- Keep headers consistent and criteria clear.
Other Link
Discover more from The Insight Orbit
Subscribe to get the latest posts sent to your email.