HomeGoogle DocsSpreadsheetHow to Do a Case Sensitive DSUM in Google Sheets

How to Do a Case Sensitive DSUM in Google Sheets

Published on

It’s possible to do a case sensitive DSUM in Google Sheets. But at the same time, I wish to make it clear that you can use Query function to get the same result as Query is case sensitive.

Still, I dedicate this tutorial for those who wish to know how to do a case sensitive DSUM in Google Sheets.

The formula may seem a little complex but nothing to worry, you can catch it.

Here in this tutorial, I am following the same method which I’ve adopted earlier in the case sensitive SUMIF, SUMPRODUCT, and COUNTIF formulas. So let’s begin.

How to Do a Case Sensitive DSUM in Google Sheets

The essence of every tutorial is well-oriented data and especially for DSUM as it’s a database function.

sample data to perform case sensitive dsum in google doc

Let me start with a normal case insensitive DSUM formula for the above dataset in A3:G8 and the criterion in A1:A2.

=DSUM(A3:G8,7,A1:A2)

The same case insensitive DSUM formula but the criterion hardcoded.

=DSUM(A3:G8,7,A1:A2)

The criterion here is “IL102B” from the “Product” column.

The DSUM formula would sum column G, i.e. field number 7, wherever the criterion would meet the value “IL102B” in column A, irrespective of its case. That means it would also sum the value for “IL102b”.

Below you can see my case sensitive DSUM formula for the above example in Google Sheets. I’ve tried to compare this with the above normal DSUM formula.

=DSUM(
     ARRAYFORMULA({A3:G3;{ARRAYFORMULA((FIND(A2,A4:A8))),B4:G8}})
     ,7
     ,{A1;1}
)

Formula Explanation

The ARRAYFORMULA part in the above formula actually acts as a virtual ‘database’. Here is the syntax to know the position (order) of the said argument in the formula.

Syntax: DSUM(database, field, criteria)

To explain what this formula does, I’ve just entered the ‘database’ part in cell N2. See the below screenshot where I’ve marked what the combination of formulas does here.

Virtual ‘database’ in Google Sheets

virtual database in Google Sheets for DSUM Case Sensitive

The formula in Cell N2 returns a virtual database in the range N2:T7.

In this (formula) A3:G3 returns the header row (see the values inside the red square) and B4:G8 returns the values except for the values from column A (see the values inside the blue square).

I think only the values in the green-colored square requires little explanation.

As a side note, if you think this’s tough to follow, I’ve shared the link of my Google Spreadsheet at the end of this tutorial. You may please check that.

The green-colored part is a FIND formula in an array form.

The FIND is a case sensitive function which returns 1 if it finds matches and else a “#VALUE!” error. See that part of the formula once again below.

=ARRAYFORMULA((FIND(A2,A4:A8)))

In Cell A2 we have our criteria “IL102B”. This FIND array formula checks this text value in the range A4:A8 and returns an array as above (green colored part in the virtual database screenshot). That’s it.

The Curly Brackets connects all the elements (creates array).

Now we have a virtual database. In this, we can apply a DSUM formula as usual. That’s what our original CASE SENSITIVE DSUM formula does.

You can scroll up and see the original formula just above the title “Formula Explanation”. In that DSUM, instead of criteria range A1:A2, I have used the following criteria.

{A1;1}

This is because, in the first column in our virtual database, the criterion “IL102B” is replaced by the value 1.

So the above criteria would do the job of our original criteria range A1:A2. It simply replaces the value in A2, i.e. “IL102B”, with 1.

If you have any doubt, you can open my Google Sheet below and make a copy of it.

Spend time in your leisure to learn this combination so you can follow this approach to make any case insensitive formula in Google Sheets to case sensitive.

Sample_Sheet_31520

Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

Analyzing Column A Between Non-Adjacent Values in Column B: Google Sheets

This tutorial addresses a common scenario encountered in Google Sheets: how to sum, average,...

Excel Word Count: Beyond SUBSTITUTE

You might want to count the number of words in a cell in Excel...

More like this

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

Analyzing Column A Between Non-Adjacent Values in Column B: Google Sheets

This tutorial addresses a common scenario encountered in Google Sheets: how to sum, average,...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.