Help needed with Sumproduct

Wimpie

Board Regular
Joined
Aug 12, 2008
Messages
210
Good day

I work with Excel 2010
Can someone please assist with the below
In a sheet called "Daily" I have the below
DateDayHours DrivenHours WorkedTotal HoursOvertime due
2016/10/01Saturday03:5302:3006:2302:23
2016/10/02Sunday02:4907:2210:1210:12
2016/10/03Monday04:0103:4707:4900:19
2016/10/04Tuesday04:3804:0108:3901:19
2016/10/05Wednesday01:4803:2205:10-2:19
2016/10/06Thursday3:3805:2608:5001:20

<tbody>
</tbody>

In a sheet called "Cycle" I have the below
Cycle NumberDate FromDate ToOvertime HoursPayment capturedDouble Overtime Hours
102016/09/192016/10/16
112016/10/172016/11/13

<tbody>
</tbody>
[/SUB]
I need a formula that would add all the Monday's to Saturdays in the Overtime Hours column between the cycle days (it should be 15:26)
And that would calculate the Sundays in the Double Overtime Hours column between the cycle days (it should be 10:12)

After a lot of reading the closest I got was the below
=SUMPRODUCT(--(Daily!$A$2:$A$2000>=Cycle!B12),--(Daily$A$2:$A$2000<=Cycle!C12),--(WEEKDAY(A2:A2000)=2),G2:G2000)
This would however only add the Mondays
I tried to use this formula to calculate the Sundays by replacing the 2 with a 1
but do not get 10:12
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

keiserj

Board Regular
Joined
May 31, 2013
Messages
89
Try this

Code:
=SUMIFS(Daily!F2:F7,Daily!A2:A7,">="&cycle!B2,Daily!A2:A7,"<="&cycle!C2)-SUMIFS(Daily!F2:F7,Daily!A2:A7,">="&cycle!B2,Daily!A2:A7,"<="&cycle!C2,Daily!B2:B7,"SUNDAY")
 
Upvote 0

Wimpie

Board Regular
Joined
Aug 12, 2008
Messages
210
Keiserj, this is amazing and 100% correct for the Overtime Hours.
Can you please assist me with the formula for the double overtime , this is the same range but should only add Sundays
 
Upvote 0

keiserj

Board Regular
Joined
May 31, 2013
Messages
89
You should just be able to delete the front half the last formula

Code:
=SUMIFS(Daily!F2:F7,Daily!A2:A7,">="&cycle!B2,Daily!A2:A7,"<="&cycle!C2,Daily!B2:B7,"SUNDAY")
 
Upvote 0

Wimpie

Board Regular
Joined
Aug 12, 2008
Messages
210
Keiserj, I figured out that by using the last bit of the formula (From the Minus) it gives me exactly the amount of double overtime for Sunday
Again a BIG THANK YOU
You have saved me days and hours of work with this formulas
 
Upvote 0

Forum statistics

Threads
1,190,565
Messages
5,981,707
Members
439,732
Latest member
TC_vii

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
Top