When trying to sum values with conditions, SUMIFS has always been our go-to function. However, when there are too many conditions, going on adding criteria, selecting criteria ranges can be a hell of a task.
This is exactly where DSUM comes into play. D standing for database, and databases are huge.
Syntax: =DSUM(database, field, criteria)
Database: Select the main table with headings.
Field: Select the heading whose contents you want to sum.
Criteria: Select the table containing conditions with headings.
Here is an example showing sales of different countries done by different salesperson residing in the respective countries. You can use the DSUM formula here in the following way.
⦁ When the criteria table is empty, DSUM gives the sum of all the values without any condition applied, just like a normal SUM function.
⦁ The criteria table should have the same formatting as in the database.
⦁ The “field” criteria in the formula can be filled with hard values, for example, here you can type ‘Sales’ (with the same formatting) instead of selecting G1 or C1.
All 3 variations above, for the formula used in the example, give the same answers.
⦁ You can add as many conditions as you want in the criteria table and modify the formula accordingly.