I am creating a spreadsheet which I have attempted to make as autonomous as possible.

We have a cell which is dedicated for tracking over time hours and double time hours. Our front office software does track our work hours however we can have multiple entries per day which can lead to multiple rows being considered for the same payroll hours.

Date Employee name Notes Customer Name Job Number Job Name Hours
2/10/17 doesn't matter doesn't matter doesn't matter 1 doesn't matter 5
2/10/17 doesn't matter doesn't matter doesn't matter 2 doesn't matter 4
2/11/17 doesn't matter doesn't matter doesn't matter 1 doesn't matter 13
2/13/17 doesn't matter doesn't matter doesn't matter 3 doesn't matter 9
2/14/17 doesn't matter doesn't matter doesn't matter 4 doesn't matter 8
2/15/17 doesn't matter doesn't matter doesn't matter 5 doesn't matter 8
2/16/17 doesn't matter doesn't matter doesn't matter 6 doesn't matter 9
2/17/17 doesn't matter doesn't matter doesn't matter 7 doesn't matter 8

This is a sample of what we deal with. Here is where things get hairy -- we are required to pay OT and DT whenever someone works more than 8 Hours a day AND anything over 40 hours/week. The first two rows would return a 1 in OT, the third would return 4 in OT and 1 in DT, the fourth 1 in OT, then the last two rows would return a 9 and 8 both in OT.

I have tried to use arrays/sumifs/sumif/match but cannot get the formula to actually return logical numbers.

any help would be great!