Excel SUMPRODUCT Function Based on Date Range (7 Examples)

 

An Introduction to the SUMPRODUCT Function

This section is mainly for beginners. It’ll explain the SUMPRODUCT function and the process of entering the formula in Excel. If you think you’ve got these basics down, move to the main section.

  • Syntax:

SUMPRODUCT is an extraordinarily multifaceted but rather flexible function suitable for summing, similar to SUMIFS.

The syntax of the SUMPRODUCT function is:

=SUMPRODUCT(array1,[array2],...)

  • Arguments:

The following arguments are in the function:

array1 – The first array or range to multiply, then add.

array2 – [optional] The second array or range to multiply, then add.


Excel SUMPRODUCT Function Based on Date Range: 7 Productive Examples

Let’s have a glimpse at the following dataset. Some Items are provided with their Order Date and Sales amount. We will use this dataset to explain the examples of the SUMPRODUCT function in Excel.

sumproduct date range

The task is to calculate the number of sales using the SUMPRODUCT function from different perspectives.

Read More: How to Use SUMPRODUCT with Criteria in Excel


Method 1 – Applying SUMPRODUCT Function on Date Range to Calculate the Total Sales Between Two Dates

Steps:

  • Select Cell G6 and enter the formula below:
=SUMPRODUCT((C5:C16>=G5)*(C5:C16<=H5)*D5:D16)
  • Press Enter to see the result.

Apply SUMPRODUCT Function on Date Range (Between Two Dates)

Here, range C5:C16 is the cell range for Order Date, Cell G5 is the start date, Cell H5 is the end date, and range D5:D16 is the number of sales.


Method 2 – Inserting Excel SUMPRODUCT to Find Sales After the Fixed Date

For the second example, you need to assume that the date is fixed. Then, you have to calculate the number of sales after the fixed date. Let’s say the fixed date in question is July 1, 2021.

Steps:

  • Select Cell G7.
  • Copy the following formula:
=SUMPRODUCT((C5:C16>=G4)*D5:D16)
  • Hit Enter to see the result.

Insert Excel SUMPRODUCT to Find Sales after Fixed Date

Here, range C5:C16 is the cell range for Order Date, >= is the logical operator for greater than or equal, Cell G4 is the fixed date, and range D5:D16 is for the number of sales. So, from 1-Jul-21 to 25-Jul-21, the sales amount is $33,650.

Read More: How to Use SUMPRODUCT Function with Multiple Columns in Excel


Method 3 – Using SUMPRODUCT to Determine Sales Before the Fixed Date

This example is similar to the earlier method except you have to put a less-than-logical operator instead of a greater-than operator.

Steps:

  • Select Cell G7 and enter the formula below:
=SUMPRODUCT((C5:C16<=G4)*D5:D16)
  • Press Enter to see the sales amount before the fixed date.

Use SUMPRODUCT to Determine Sales Before Fixed Date

Here, range C5:C16 is the cell range for Order Date, <= is the logical operator for less than or equal, Cell G4 is the fixed date, and range D5:D16 is for the number of sales. So, from 1-Jun-21 to 8-Jul-21, the sales amount is $34,750.

Read More: How to Use SUMPRODUCT IF in Excel


Method 4 – Implementing Excel SUMPRODUCT Function to Find Sales in a Month

For this purpose, you have to take the first date of a month as the start date and the last day of the month as the end date. In this case, we will find the sales amount for June.

Steps:

  • Select Cell G6.
  • Copy the formula below to Cell G6:
=SUMPRODUCT((C5:C16>=G5)*(C5:C16<=H5)*D5:D16)
  • Hit Enter to see the sales amount for June.

Implement Excel SUMPRODUCT Function to Find Sales in a Month

Here, range C5:C16 is the cell range for Order Date, Cell G5 is the start date, Cell H5 is the end date, and range D5:D16 is the number of sales.


Method 5 – Applying SUMPRODUCT to a Date Range That Includes Weekends

Suppose that the given date range has weekends, and you have to determine the number of sales for the weekends along with the date range.

To do so, you’ll need the WEEKDAY function. The function returns a day of the week from a date, depending on the kind of return (return type). Then, the SUMPRODUCT function will be used to summarize all the numbers corresponding to the designated weekend days.

  • Syntax:

The syntax of the WEEKDAY function is:

=WEEKDAY(serial_number,[return_type])

  • Arguments:

The arguments are as follows:

serial_number – It is the compulsory argument that gets you the desired day of the week.

return_type – This is an optional argument. It is a mapping scheme that denotes the serial of the days of the week. For example, if you insert 1, the number 1 will represent Monday, and the number 7 will represent Sunday.

Steps:

  • Select Cell H7 and copy the formula below:
=SUMPRODUCT((WEEKDAY(C5:C16,2)>=6)*E5:E16)
  • Press Enter to see the sales amount on weekends.

Apply SUMPRODUCT If Date Range Includes Weekends

Here, range C5:C16 is for the Order Date, 2 is for Monday (generally return_type of 1 refers to Sunday), 6 is for Saturday, and range E5:E16 is for the number of sales. The formula adds up all the sums pertaining to Saturday and Sunday.

Read More: How to Use SUMPRODUCT to Lookup Multiple Criteria in Excel


Method 6 – Using SUMPRODUCT Based on a Date Range With Single Criterion

Let’s say you want to calculate the total sales of Monitors within a specific period.

Steps:

  • Select Cell G7 and enter the formula below:
=SUMPRODUCT((C5:C16<=G4)*D5:D16)
  • Hit Enter to see the sales amount with a single criterion.

Here, range B5:B16 is the range for Items, Cell G6 is for an item named Monitor, range C5:C16 is for the Order Date, Cell G5 is the start date, Cell H5 is the end date, and range D5:D6 is the number of sales.

Read More: Excel SUMPRODUCT with Multiple Criteria in Same Column


Method 7 – Inserting SUMPRODUCT Based on a Date Range With Multiple Criteria

Let’s imagine that the amount of sales is not given. However, the quantity and unit price are provided. Now, how can you calculate the sales?

You can find the sales by the multiplying the quantity and unit price for each item. But what will happen if a date range is given?

In such a scenario, you can also use the SUMPRODUCT function. It will add up the products that meet the date range.

Steps:

  • Select Cell H7.
  • Copy the following formula:
=SUMPRODUCT((C5:C16>=H5)*(C5:C16<=I5)*D5:D16*E5:E16)
  • Hit Enter to see the result.

In this formula, range C5:C16 is the cell range for Order Date, Cell H5 is the start date, Cell I5 is the end date, range D5:D16 is the quantity, and range E5:E16 is the unit price.


Things to Keep in Mind

  • Be careful while inserting the formula, especially with the logical operator and parentheses.
  • Be cautious about the file name, file location, and the extension name of Excel.

Download Practice Workbook

You can download the practice workbook from here.


Related Articles


<< Go Back to Excel SUMPRODUCT Function | Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Md. Abdul Kader
Md. Abdul Kader

MD. ABDUL KADER is an engineer with a talent for Excel and a passion for VBA programming. To him, programming is like a time-saving wizard, making data manipulation, file handling, and internet interactions a breeze. His skill set extends to SWM, GIS, RS, and SPSS. He holds a B.Sc in Urban & Regional Planning from Chittagong University of Engineering and Technology and has shifted to become a content developer. In this role, he crafts technical content centred around... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo