How to Use OR Criteria in Database Functions in Excel

Stack conditions on separate rows of a criteria range to get OR logic in DSUM — and mix AND and OR in one range.

You will learn to

  • Use two rows for OR on the same field
  • Use OR across different fields
  • Combine AND within rows and OR between rows

How it works

The criteria range of a database function follows one simple rule: conditions on the same row are combined with AND, and separate rows are combined with OR. So a Category header with Travel on one row and Meals on the next totals both categories, with no SUMIFS-plus-SUMIFS needed.

The rule also handles harder logic. Put Department and Status side by side and stack two rows — Sales/Pending and Marketing/Pending — and DSUM totals (Sales AND Pending) OR (Marketing AND Pending). A record that matches more than one row is still counted once.

=DSUM(A1:E13,"Amount",G1:G3)