Quick Answer

DSUM Function

Sums the values in a database column for rows that meet the criteria.

✓ Excel✓ Google SheetsExcel All versions

Syntax

DSUM
(database, field, criteria)

Parameters

ParameterDescriptionRequired
databaseThe range containing the database, including the header row as the first row.Required
fieldThe column to sum, given as the column label in quotes (e.g. "Yield") or its 1-based column index.Required
criteriaThe 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)
Result24

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 criteria

Pass the 1-based column position of Profit (column 5) as the field argument.

=DSUM(A1:E7, 5, A9:B10)
Result: 180
The same two matching rows have Profit 105 and 75, so the sum is 180.

Example 2: Combine with other conditions

Sum Yield for apple trees with Age greater than 12

Extend the criteria range with an Age column and condition >12 below the Apple/Height condition.

=DSUM(A1:E7, "Yield", A9:C10)
Result: 24
Both tall apples (Age 20 and 15) exceed 12, so Yield 14 and 10 still sum to 24.

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.

1
Set up the database
Enter your table with a header row; here A1:E7 with Tree, Height, Age, Yield, Profit.
2
Set up criteria
Place criteria headers and values in a separate range, e.g. A9:B10.
3
Enter DSUM
Type =DSUM(A1:E7, "Yield", A9:B10) and press Enter.

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

Practice 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.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Frequently Asked Questions

Can DSUM use a column index instead of a name?
Yes. Supply the 1-based column position, e.g. 4 for the fourth column, instead of "Yield".
Does DSUM ignore text in the field?
Yes. Only numeric values in the matching rows are added; text and blank cells are ignored.
How is DSUM different from SUMIF?
DSUM filters a multi-column database by an entire criteria range (with AND/OR logic), while SUMIF handles a single condition over one range.