TRUECALC
Functions

DSUM

Sum of field values for rows matching criteria

Try it

When to use it

When should I use DSUM?

Use DSUM to total a field across only the rows that match one or more criteria in a database table — it is the database-style equivalent of SUMIF but works with header-named criteria ranges.

Used in

operations · sales

Syntax

DSUM(database, field, criteria)

Examples

=DSUM({"Product","Revenue";"Apple",100;"Banana",200;"Apple",150},"Revenue",{"Product";"Apple"}) // => 250
=DSUM({"Product","Revenue";"Apple",100;"Banana",200;"Apple",150},2,{"Product";"Apple"}) // => 250
=DSUM({"Product","Revenue";"Apple",100;"Banana",200},2,{"Product";"Cherry"}) // => 0

On this page