The DSUM function in Google Sheets is a database function that adds up the numbers in a range of cells that meet specific criteria. It works similarly to the SUMIF and SUMIFS functions but is particularly useful when dealing with a range of cells organized as a database table.
The syntax for DSUM is:
DSUM(database, field, criteria)
Here's a breakdown of how it works:
Database: This is the range of cells that make up your database. The first row should contain your column labels (headers), and the rows below contain the data.
Field: This indicates which column to sum. You can specify the field either by its name (as given in the header row) or by its index number (1 for the first column, 2 for the second column, etc.).
Criteria: This is a range of cells that specifies the conditions you want to apply. The criteria range should include at least one column label and at least one cell below the column label to specify the condition.
Suppose you have a table like this:
If you want to sum the scores for people aged 23, you could set up a criteria range elsewhere in your sheet like this:
Then you would use the DSUM function as follows:
DSUM(A1:C4, "Score", E1:E2)
This function will sum the "Score" column (C) for rows in the range A1:C4 where the "Age" column (B) is 23. The result would be 950, as it adds 500 (John's score) and 450 (Mike's score).
We hope that this article has helped you and given you a better understanding of the Google Sheets DSUM function. If you enjoyed this article, you might also like our articles on how to use a Google Sheets wildcard and how to trace dependents in Google Sheets.