SUMIF with MOD

MossackFonseca

New Member
Joined
Aug 25, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello!

Perhaps you could help ...

Column A value
Column B item start date
Column C item end date

Need to sum only the values that have item duration divisible by 12.

I believe it is a combination of SUMPRODUCT, MOD, DATEDIF and perhaps "--", but not sure how to put them together. I know about the option to create a separate column, but need it in one single formula.

Any help is much appreciated! Thank you!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Welcome to the MrExcel forum!

Try:

Book4
ABCDE
1ValueStart DateEnd DateSum of 12X duration
211/1/20211/3/202111
322/1/20212/13/2021
433/1/20213/25/2021
544/1/20214/2/2021
654/10/20215/10/2021
767/1/20218/30/2021
Sheet11
Cell Formulas
RangeFormula
E2E2=SUMPRODUCT(A2:A7,--(MOD(C2:C7-B2:B7,12)=0))
 
Upvote 0
Solution
Thank you! It works!

How can I add another criteria to this formula above: sum those values for which the end date is higher than x?
 
Upvote 0
Easy enough:

Book1
ABCDEF
1ValueStart DateEnd DateSum of 12X durationDate
211/1/20211/3/202193/1/2021
322/1/20212/13/2021
433/1/20213/25/2021
544/1/20214/2/2021
654/10/20215/10/2021
767/1/20218/30/2021
Sheet3
Cell Formulas
RangeFormula
E2E2=SUMPRODUCT(A2:A7,--(MOD(C2:C7-B2:B7,12)=0),--(C2:C7>F2))
 
Upvote 0

Forum statistics

Threads
1,223,892
Messages
6,175,236
Members
452,621
Latest member
Laura_PinksBTHFT

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