Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Use Excel DSUM with Multiple Criteria

Use DSUM to total matching records. Build a criteria range, combine conditions with AND or OR, and test formulas using two examples.

Table of Contents

Use DSUM to total one numeric column for records that match a criteria range. The criteria are visible on the worksheet, so you can change the conditions without editing the formula.

DSUM syntax

=DSUM(database, field, criteria). Include the source headers in database. For field, use the exact header in quotes, a reference to its header cell, or its position within the database range. For criteria, include the matching header cells and the condition rows below them. Some regional settings use semicolons in place of commas.

DSUM Function: How to Sum with Complex Conditions in Excel Picture 1

Example 1: Sum totals for products that start with iPhone

For data in A6:E13 and the amount header in E6, copy the product header to C2, enter iPhone* in C3, and use =DSUM(A6:E13,E6,C2:C3). The asterisk matches any number of characters after iPhone. Using the header cell avoids guessing the exact spelling of the amount column.

DSUM Function: How to Sum with Complex Conditions in Excel Picture 2

DSUM Function: How to Sum with Complex Conditions in Excel Picture 3

DSUM Function: How to Sum with Complex Conditions in Excel Picture 4

DSUM Function: How to Sum with Complex Conditions in Excel Picture 5

Example 2: Sum totals where the quantity is at least five

Replace C2 with the exact sales-quantity header from the database and enter >=5 in C3. The same DSUM formula now totals the amount for rows meeting the quantity condition.

DSUM Function: How to Sum with Complex Conditions in Excel Picture 6

DSUM Function: How to Sum with Complex Conditions in Excel Picture 7

DSUM Function: How to Sum with Complex Conditions in Excel Picture 8

Combine criteria with AND or OR

ProductSales Quantity
iPhone*>=5
iPad*>=10

Use the actual headers from your data. Conditions on the same row must both match. Different rows are alternatives. This example includes iPhone rows with quantities of at least five or iPad rows with quantities of at least ten. Omit unintended blank rows from the criteria range because a blank condition row can match everything.

If the result is unexpected, check headers, numeric cells stored as text, and whether the database range includes every record. See Microsoft’s DSUM examples and related Excel functions.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.