HomeGoogle DocsSpreadsheetCorrectly Specifying Criteria in SUMPRODUCT in Google Sheets

Correctly Specifying Criteria in SUMPRODUCT in Google Sheets

Published on

Why is it important to learn how to correctly specify criteria in the SUMPRODUCT function, given its role in calculating the sum of products?

SUMPRODUCT is an array function in Google Sheets used for finding the sum or products. Additionally, it can be employed for conditional sums or counts, depending on the criteria applied. Therefore, it’s crucial to understand the proper specification of text, date, and numeric criteria with this function.

You must know how to hardcode as well as use cell references when specifying criteria in functions, as it might slightly vary from function to function.

Allow me to assist you in mastering the specification of text, date, and numeric criteria within the SUMPRODUCT function in Google Sheets. Below, you’ll find a simple chart (table) that will aid in this process.

We will use the following sample data for reference:

Sample data illustrating how to specify criteria in SUMPRODUCT

In the sample data, column A contains the sales date, Column B contains the name of the salesperson, Column C contains the area of sales, and Column D contains the sales amount. The actual data range is not A1:D, but A1:D11, where A1:D1 contains field labels.

Sumproduct Criteria Specification Reference Chart

In the table below, the first column describes the type of criteria you want to use, the second column demonstrates how to specify hard-coded criteria, and the third column indicates what you should enter in cell F1 to specify it in the formula.

Data TypeHardcodedCell Reference
(F1)
Example Formula
Text:
“North”North=SUMPRODUCT(
C2:C11="North", D2:D11
)

=SUMPRODUCT(
C2:C11=F1, D2:D11
)
Numeric:
500500=SUMPRODUCT(
D2:D11=500
)

=SUMPRODUCT(
D2:D11=F1
)

>500500=SUMPRODUCT(
D2:D11>500
)

=SUMPRODUCT(
D2:D11>F1
)
Date:
DATE(2024, 3, 22)22/03/2024
DD/MM/YYYY or
MM/DD/YYYY
=SUMPRODUCT(
A2:A11>=DATE(2024, 3, 22),
D2:D11
)

=SUMPRODUCT(
A2:A11>=F1,
D2:D11
)
>DATE(2024, 3, 20)
As per:
DATE(year, month, day)
20/03/2024
DD/MM/YYYY or
MM/DD/YYYY
=SUMPRODUCT(
A2:A11>=DATE(2024, 3, 20),
D2:D11
)

=SUMPRODUCT(
A2:A11>=F1,
D2:D11
)

Specifying Multiple Criteria

In all the above examples, we have used a single criterion. You can follow the same syntax when specifying multiple criteria in the SUMPRODUCT function.

For example, assume you want to count the number of sales in the “South” region in March 2024. You can use the following SUMPRODUCT for that:

=SUMPRODUCT(
   (C2:C11="South")*
   ((EOMONTH(A2:A11, -1)+1)=DATE(2024, 3, 1))
)

In this formula, the EOMONTH function returns the end of the month dates of the dates in the range A2:A11. Adding 1 to that converts it to the beginning of the month dates. So we can use 01/03/2024 as the criterion.

In this complex SUMPRODUCT formula, we have specified hard-coded criteria. How do we specify criteria as cell references?

=SUMPRODUCT(
   (C2:C11=F1)*
   ((EOMONTH(A2:A11, -1)+1)=F2)
)

Specify “South” (without double quotes) in cell F1 and 01/03/2024 in cell F2.

If your sales data in A2:A11 are contained within 2024, you do not need to worry about using the EOMONTH function. You can simply specify the month number in the formula as follows:

=SUMPRODUCT(
   (C2:C11="South")*
   ((MONTH(A2:A11)=3)
)

The EOMONTH approach is particularly useful in formulas when you want to consider both the month and year instead of just the month. If you do not use EOMONTH, then you might want to use two criteria, one for matching the month and the other for matching the year.

Resources

You now have a chart to refer to on how to correctly specify criteria in the SUMPRODUCT function in Google Sheets. Additionally, I’ve provided a couple of examples that clearly demonstrate the use of criteria. Here are some additional resources.

  1. How to Use Date Differences as Criteria in SUMPRODUCT in Google Sheets
  2. Differences Between SUMIFS and SUMPRODUCT Functions in Google Sheets
  3. Comparing SUMIFS, SUMPRODUCT, and DSUM with Examples in Google Sheets
  4. How to Do a Case Sensitive Sumproduct in Google Sheets
  5. How to Use OR Condition in SUMPRODUCT in Google Sheets
  6. How to Use Wildcards in Sumproduct in Google Sheets
  7. How to Use Sumproduct with Merged Cells In Google Sheets
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.

Running Total By Month in Excel

This tutorial demonstrates how to calculate the running total by month in a range...

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

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.