Excel functions / Database

DSUM function

Adds up a column of a table for the rows that meet conditions written in cells.

Syntax

=DSUM(database, field, criteria)

Arguments

When to use it

DSUM adds up one column of a table for the rows that meet conditions, like SUMIFS. The difference is where the conditions live: in a small range of cells, with the column labels above them, instead of inside the formula.

That makes the conditions something a person can change by typing in a cell. Conditions on the same row must all be true; a second row of conditions is an alternative.

Examples

  1. North, and more than 500

    ABCDE
    1RegionSales
    2North>5002100
    3
    4RegionRepSales
    5NorthAna1200
    6SouthBen800
    7NorthChloe900
    8WestAna400
    9NorthAna300

    In E2: =DSUM(A4:C9, "Sales", A1:B2) → 2100

    The criteria range is A1:B2: two labels, and one condition under each.

    Try this example

  2. One condition

    ABCDE
    1RegionSales
    2North>5002400
    3
    4RegionRepSales
    5NorthAna1200
    6SouthBen800
    7NorthChloe900
    8WestAna400
    9NorthAna300

    In E2: =DSUM(A4:C9, "Sales", A1:A2) → 2400

    Try this example

  3. North or West: a second row of criteria

    ABCDE
    1Region
    2North2800
    3West
    4RegionRepSales
    5NorthAna1200
    6SouthBen800
    7NorthChloe900
    8WestAna400
    9NorthAna300

    In E2: =DSUM(A4:C9, "Sales", A1:A3) → 2800

    Try this example

Common mistakes

Common questions

What is the difference between DSUM and SUMIFS?

Both add up rows that meet conditions. SUMIFS takes its conditions as arguments in the formula; DSUM reads them from a range of cells, and can combine them with OR by using more than one row.

DSUM in other languages

Excel shows function names in its own language. In these languages it also puts a semicolon between arguments where English has a comma.

Translate a whole formula

Try DSUM in the playground

Related functions