SUMPRODUCT for range of dates

Ashinda

New Member
Joined
Jul 22, 2018
Messages
5
Hi all,

I've had a look through MrExcel (and other websites) and I'm struggling to adapt the answers found there to my problem.

I currently have the following that refers to a single date (K2):
Code:
[FONT=Calibri][SIZE=3][COLOR=#000000]=IF(SUMPRODUCT( -- ($J$2 = Data'!$Y$2:$Y$5000), -- (AF5= Data!$AP$2:$AP$5000),('Data'!$AQ$2:$AQ$5000))<1,"",SUMPRODUCT(-- ($J$2 = Data!$Y$2:$Y$5000), -- (AF5= Data!$AP$2:$AP$5000),(Data!$AQ$2:$AQ$5000)))[/COLOR][/SIZE][/FONT]

However I need to change the formula so that it ranges from one date (K2) to another (let's go with P2).

Is it possible to adapt the formula I currently use or will I have to go back to square one?

Thank in advance :)
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Why not just this?

=MAX(0,SUMPRODUCT(
'Data'!$AQ$2:$AQ$5000,
--($J$2=Data'!$Y$2:$Y$5000),--(AF5=Data!$AP$2:$AP$5000))

Or this which is faster?

=MAX(0,SUMIFS(
'Data'!$AQ$2:$AQ$5000,
Data'!$Y$2:$Y$5000,
$J$2
,Data!$AP$2:$AP$5000,
AF5)
<strike></strike>
 
Upvote 0
Hey Aladin,

Thanks for your quick response.

That works fine for referencing the one date, but if I want it to range over a certain period of time, say from 23/06/2018 (J2) to the 15/07/2018 (P2)

How would I incorporate this into the formula given?

Also, I love that you've been able to put SUMIFS, means I can just reference the entire column now. Living the dream.
 
Upvote 0
Hey Aladin,

Thanks for your quick response.

That works fine for referencing the one date, but if I want it to range over a certain period of time, say from 23/06/2018 (J2) to the 15/07/2018 (P2)

How would I incorporate this into the formula given?

Also, I love that you've been able to put SUMIFS, means I can just reference the entire column now. Living the dream.

Like this:

=MAX(0,SUMIFS('Data'!$AQ$2:$AQ$5000,Data'!$Y$2:$Y$5000,">="&$J$2,Data'!$Y$2:$Y$5000,"<="&$P$2,Data!$AP$2:$AP$5000,AF5)​
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top