DSUM Function
Sums the values in a database column for rows that meet the criteria.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| database | The range containing the database, including the header row as the first row. | Required |
| field | The column to sum, given as the column label in quotes (e.g. "Yield") or its 1-based column index. | Required |
| criteria | The range with a header row matching database column names and one or more condition rows; only matching records are summed. | Required |
Basic Example
Sum the Yield of apple trees taller than 10
=DSUM(A1:E7, "Yield", A9:B10)The criteria A9:B10 (Tree=Apple, Height>10) matches two rows with Yield 14 and 10, which add up to 24.
Advanced Examples
Example 1: Field referenced by column index
Sum Profit instead of Yield without editing the criteriaPass the 1-based column position of Profit (column 5) as the field argument.
=DSUM(A1:E7, 5, A9:B10)Example 2: Combine with other conditions
Sum Yield for apple trees with Age greater than 12Extend the criteria range with an Age column and condition >12 below the Apple/Height condition.
=DSUM(A1:E7, "Yield", A9:C10)How DSUM Works
DSUM filters the database down to the rows matching the criteria range, then totals the numeric values found in the specified field column of those rows. Non-numeric and blank cells in the field are ignored by the sum.
Important Notes & Limitations
Only numeric values in the field are summed; text and blanks are skipped.
Criteria header labels must exactly match database headers.
DSUM ignores records the criteria filter out entirely, so an over-broad criteria returns a larger total.
Common Errors & Fixes
#VALUE!The field was supplied as an unquoted column name rather than text or a number.Fix: Wrap the field name in quotes, e.g. "Yield", or use the column index.
0 resultCriteria headers do not match the database, so no rows match.Fix: Make criteria header text identical to the database column name.
Download Practice File
DSUM
dsumPractice DSUM with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the DSUM function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps