Sumproduct/Mod/Datedif

Tequilashot

New Member
Joined
Aug 17, 2015
Messages
33
Hello, need some help consolidating a formula to allow me to have reaccuring quarterly costs based off multiple completion dates in a single row.

Row 18 is my desired result but without the need for rows 13-17.

I've attempted a SUMPRODUCT/MOD/DATEDIF in row 20 to try and arrive at the answer but no luck...anyone got any ideas?

Cell Formulas
RangeFormula
C6:C9C6=EDATE(C5,3)
C12:V12C12=EDATE(B12,1)
B13:V17B13=IFERROR((MOD(DATEDIF($C5,B$12,"m"),4)=0)*-$D5*$D$2,0)
B18:V18B18=SUM(B13:B17)
B20:V20B20=SUMPRODUCT(MOD(DATEDIF($C$5:$C$9,B$12,"m"),4)=0,$D$2*$D$5:$D$9)
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Try in B20:

Excel Formula:
=SUMPRODUCT(--(B12>=$C$5:$C$9),--(MOD(MONTH(B12),4)=MOD(MONTH($C$5:$C$9),4)),$D$5:$D$9)*-$D$2
 
Upvote 0
Awesome thanks, worked for me!

I see the double minus sign quite often when googling around but I don't really understand them, will have to check it out further.
 
Upvote 0
Glad it works for you! :cool:

The double minus sign (or double unary) is just a way to convert a TRUE/FALSE response from a conditional to a 1/0 value so that SUMPRODUCT can multiply with it. You can find a lot about it online.
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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