Jun 26, 2014

I've been trying to automate the calculations on timesheets and having some trouble. I've attached a rough copy of part of the sheet to this post.

Here's where I'm struggling:

The timesheet has columns for Ins/Outs as well as Reg Hrs (Should never be more than 8), OT 1.5 (Standard 1.5 OT pay for anything over 40 in a week), OT 1.0 (More than 8 hours worked in a day but Vacation/Sick/Holiday/Funeral time keeps it below 40 hours actual work time that week) and then columns for Vacation, Sick, Etc.

Now I'm confident that my Regular Hours works with the following formula:

=IF((((C3-B3)+(E3-D3))*24)>=8,8,((C3-B3)+(E3-D3))*24)

If statement calculates how many hours worked, multiples it by 24 to put it in an hour format and checks whether it's greater than or equal to 8, if so then only show 8 (since any additional hours worked would need to be in the OT 1.5 or OT 1.0 category depending on the circumstances). If false, returns how many hours worked.

However, I am having some issues getting my OT 1.5 and OT 1.0 categories working correctly. The OT 1.5 column needs to check whether the actual worked hours is over 40 without Vacation/Sick/Funeral, etc included. The OT 1.0 column needs to show any additional hours worked beyond 8 each day but less than 40 over the whole week because of holiday/sick/vacation, etc.

So, if I worked 10 hours on Monday and there isn't any sort of paid leave time that week (and I work normal 8 hours the rest of the week), then Monday would show 8 hours in Regular worked and 2 hours in OT 1.5. Here's what I'm currently using for a formula (that isn't working...my latest addition was the OR statement):

=IF(AND((((C3-B3)+(E3-D3))*24)>8, OR(($F$12-$K$12)>40), $K$12=0), (((C3-B3)+(E3-D3))*24)-8, "")

If I worked 10 hours on Monday and there is some sort of Holiday (and I don't actually work over 40 hours that week not including the 8 hours of Holiday pay), then Monday should show 8 hours in Regular time and 2 hours in OT 1.0. Here's what I'm using for this formula (that also isn't working well and I hadn't started working with the OR statement here yet since OT 1.5 wasn't working) :

=IF(AND((((C3-B3)+(E3-D3))*24)>8, $K$12 > 0, $F$12<40), (((C3-B3)+(E3-D3))*24)-8, "")

testsheet.xlsx

View 3 Replies
View Related