HomeGoogle DocsSpreadsheetHow to Do a Case Sensitive SUMIF in Google Sheets

How to Do a Case Sensitive SUMIF in Google Sheets

Published on

It’s possible to do case sensitive SUMIF in Google Sheets! Yes, you heard me right. Many people think that Case Sensitive SUMIF in Google Sheets is not possible. But it’s on the contrary.

I will explain to you how to do a Case Sensitive SUMIF in Google Sheets. No helper column or virtual helper column require in this case.

Normally SUMIF is a case-insensitive function. But with a combination of formulas, you can do a case-sensitive SUMIF.

In concise, to do a case-sensitive SUMIF, you should make use of any case-sensitive formula with it.

The available case sensitive functions here in Google Sheets are Exact, Find and Query. Both Exact and FIND are text functions.

But with SUMIF, we can use FIND function only, not Exact. The query is entirely different, and it can even work like a case-sensitive SUMIF. That part, I will try to explain to you in the last part of this tutorial!

How to Do a Case Sensitive SUMIF in Google Sheets – Steps

Sample Data:

Steps: Case Sensitive SUMIF in Google Sheets

Here is a normal SUMIF formula to sum the amount for Product “IL102b”. The formula would obviously return a wrong result.

Normal SUMIF Formula

=sumif(A2:A5,"IL102b",G2:G5)

Expected Result: 675.00

Actual Result Returned: 1125.00

Formula Explanation:

In this formula A2: A5 is the range, “IL102b” is the criterion and G2: G5 is the sum range.

Why does the formula return an inaccurate result?

The formula is perfect. But the problem here is, SUMIF treats both “IL102b” and “IL102B” as identical and sums column G accordingly. As already told, SUMIF is a case-insensitive function.

The Case-sensitive SUMIF formula

Here is the case-sensitive SUMIF formula. As I have already told you, we should use one case-sensitive formula together with SUMIF and that function is FIND. Here is that combo.

=sumif(ArrayFormula((find("IL102b",A2:A5))),1,G2:G5)

Expected Result: 675.00

Actual Result Returned: 675.00

I’ll explain to you how this formula works.

Here I’ve replaced the range A2: A5 in the normal SUMIF formula with the following formula.

ArrayFormula((find("IL102b",A2:A5)))

What does this formula do?

Google Sheets Find function looks for the exact value “IL102b” in the range A2: A5. When independently used as below, this formula would throw an error. The reason, we can only use a cell reference not range with this formula.

=find("IL102b",A2:A5)

So an ArrayFormula combination can work here and the result would be as follows. This replaces our original range A2: A5.

Wherever the value “IL102b” in the range A2: A5 appears, the Find ArrayFormula combo returns 1.

Here in our case, there is only one match and so 1 appears only one time. Since this is our new range, we can use 1 as the criterion instead of “IL102b”. That’s all.

As a side note, the same trick is applicable to SUMIFS also. Now for your information, if you are not very much particular to use the case-sensitive SUMIF formula in Google Sheets, you can use a simple QUERY function as an alternative as below for our above example range.

QUERY Formula Alternative to Case Sensitive SUMIF in Google Sheets

=query(A2:G5,"Select Sum(G) where A='IL102b' label Sum(G)''")

Hope you have enjoyed the stay here! Thanks.

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.

SORT and SORTBY – Excel Vs Google Sheets

While Excel offers the SORT and SORTBY functions for sorting a table, Google Sheets...

Get Top N Values Using Excel’s FILTER Function

When using the FILTER function in Excel to extract the top N values, it's...

XLOOKUP in Excel: Working with Visible Rows in a Table

In Excel, the XLOOKUP function isn't inherently designed to exclusively work with visible rows;...

SUMPRODUCT Differences: Excel vs. Google Sheets

The core purpose of the SUMPRODUCT function remains consistent across both Excel and Google...

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,...

2 COMMENTS

    • Hi, RC,

      The Query alternative to case sensitive SUMIF would work with other tabs.

      Just include tab name with the Query ‘Data’.

      Eg.:

      =query('company 1'!A2:G5,"Select Sum(G) where A='IL102b' label Sum(G)''")

      In this “company 1” is the tab name.

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.