Category: FUNCTION | Updated: 2026-11-22
How to Use the DSUM Function in Google Sheets | Sum Values from a Database Matching Criteria
Syntax
=DSUM(database, field, criteria)
- database: Specifies the entire cell range of the data, including headers (field names) in the first row.
- field: Specifies the header name of the column to sum (enclosed in double quotes) or its column number counting from the left.
- criteria: Specifies the cell range containing the filter conditions (headers in the first row, condition values in subsequent rows).
Practical Example with a Table
Here is an example of summing sales amounts from sales data (A1:C5) where the criteria range (E1:F2) specifies “Rep is Sato AND Sales is ¥10,000 or more.”
| Cell Range | Role | Contents |
|---|---|---|
A1:C5 |
Database | Row 1: Rep, Product, Sales / Rows 2–5: sales detail records |
E1:F2 |
Criteria Range | E1 = Rep, E2 = Sato, F1 = Sales, F2 = >=10000 |
| Formula Cell | Sum Result | =DSUM(A1:C5, "Sales", E1:F2) → Outputs total sales for matching records |
Common Errors and Notes
- #VALUE! Error: Occurs if the column name specified in
fielddoes not exist in the first row ofdatabase, or if thedatabaserange does not include the header row. - Watch Out for Blank Rows in Criteria Range: Including a blank row in the criteria range causes it to match “all records,” returning the sum of the entire dataset.
- Writing AND vs. OR Conditions: Placing conditions on the same row in the criteria range treats them as “AND” conditions; placing them on separate rows treats them as “OR” conditions.
Frequently Asked Questions
Q. What is the difference between the DSUM function and the SUMIFS function?
A. SUMIFS writes conditions directly inside the formula, whereas DSUM references a separate "header + condition" criteria table on the sheet. DSUM is convenient when you want to visually manage OR conditions or complex multi-condition filters.
Q. Do the "headers" in the criteria range need to match the database column names exactly?
A. Yes. The field names (headers) entered in the first row of the criteria range must match the first-row headers of the database character-for-character.