AND, OR in Multiple Criteria DSUM in Google Sheets (Within Formula)

Are you struggling with using multiple criteria in Google Sheets’ DSUM function? Don’t worry, I’ve got you covered! In this tutorial, I’ll teach you how to master the art of multiple criteria DSUM, including the use of AND and OR conditions within the formula. So get ready to level up your Google Sheets skills!

DSUM Database Function in Google Sheets

Before we dive into the nitty-gritty, let’s understand the structure of the DSUM function in Google Sheets.

Syntax:

DSUM(database, field, criteria)

Now let’s explore some advanced DSUM formula examples with single and multiple criteria.

DSUM with Single Criterion in Google Sheets

Using a single criterion in DSUM is straightforward when you have the criteria in the form of cell references. Let’s take a look at an example:

Criterion as Cell Reference:

=DSUM(A1:E7,3,G1:H2)

In this example, we are summing the values in column C (maths) based on the criterion provided in cells G1 and H2. But what if we want to include the criterion within the formula itself? Let’s find out!

Criterion within Formula:

=dsum(A1:E7,3,transpose({"name","Student 1"}))

By using the transpose function, we can include the criterion directly within the DSUM formula. This technique will come in handy when dealing with multiple criteria DSUM.

DSUM with Multiple Criteria in Google Sheets

Now, let’s explore the exciting world of multiple criteria DSUM! We’ll discuss how to use the AND and OR conditions effectively.

OR Condition in Multiple Criteria DSUM in Google Sheets

In DSUM, the OR condition is automatically applied when you have multiple conditions in the same column. Take a look at this example:

Criteria as Cell Reference:

=dsum(A1:E7,3,G1:H4)

This formula sums column C (maths) if the values in column A are “Student 1”, “Student 2”, or “Student 3”. But we can also include the criteria within the formula itself, like so:

Criteria within the Formula:

=dsum(A1:E7,3,transpose({"name","Student 1","Student 2","Student 3"}))

By using the transpose function, we can create a virtual array of criteria directly within the DSUM formula. Cool, right?

AND Condition in Multiple Criteria DSUM in Google Sheets

To use the AND condition in DSUM, all the provided conditions must be met. Let’s dive into an example:

Criteria as Cell Reference:

=dsum(A1:E7,3,G1:H2)

In this formula, we sum column C (maths) if the value in column A is “Student 1” and the value in column B is “Second”. But we can also include the criteria within the formula itself using the transpose function:

Criteria within Formula:

=dsum(A1:E7,3,transpose({"name","Student 1";"term","Second"}))

By recreating the criteria within the DSUM formula, we ensure that all conditions are met to obtain the correct output.

Conclusion

Congratulations! You’ve now mastered the art of using multiple criteria in DSUM within Google Sheets. You’ve learned how to include the AND and OR conditions within the formula, making your data analysis more efficient than ever. But don’t stop here, there’s always more to learn!

Stay tuned for my next post, where I’ll share how to sum multiple fields in DSUM. Until then, keep exploring and maximizing the power of Google Sheets!

Crawlan.com – Your go-to resource for all things Google Sheets!

Related posts