Mathematical Help Needed Bad

JoeSalmi

Board Regular
Joined
Jan 31, 2011
Messages
128
I have a time sheet that I seriously need help on. I've kind of got it but it just isn't right and it isn't doing what I wanted it to do.

I don't mind if it is VBA or formula I just need it to calculate right.

Here's what I got.

I have a timesheet that tracks the time an employee clocks in, out, and how long they take for lunch. I also track how long they work on a job and this tracked in many places other than the time sheet itself. This is all tracked Mon-Sun and ran back to another worksheet called "mainpage". At this point it really isn't important, I just need the math to come out right.

Attached is a copy of one of the time sheets adjusted with the correct numbers so that it doesn't try to refer back to my original spreadsheet.

Download Timesheet

okay so in column C14:C40 it tracks the # of hours the employee spent on each job and totals them in C43. However this employee can only work a regular 8 hours and anything over that is considered overtime. So if he works 10 hours on Monday then he has earned 8 regular hours and 2 overtime hours.

This goes on all the way through Sunday however,
1. The week doesn't always start on Monday, and
2. Once the employee has hit 40 regular hours all additional time is considered overtime.

I need the time sheet to display the # of regular hours and the # of overtime hours for each day and then have it also show me at the end of the timesheet such as "total regular hours and total OT hours".

I also have a section for the ability to add comp hours that don't actually add to the "timesheet" but it does add to his total hours for payment. You can see how I calculated all this once you DL the SS but the way it is bothers me cause it isn't 100% correct.

Any and all help is welcomed and VERY appreciated. I've been working on this for over a year and I must have changed it a dozen times. I just can't keep trying to figure it out alone.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
If I understand your overtime policy correctly, a person earns premium pay for any hours over 8 in a single day and any time over 40 in a week with no special regard for Saturday or Sunday. If this is incorrect, repost more detail about your policy and I can try to make adjustments.

Try the below and see if you get the results you are seeking.

For cell H43: =IF(SUM(C43:G43)<40,MIN(40-SUM(C43:G43),H40),0)
For cell I43: =IF(SUM(C43:H43)<40,MIN(40-SUM(C43:H43),I40),0)
For cell H44: =SUM(H14:H40)-H43
For cell I44: =SUM(I14:I40)-I43
 
Upvote 0
Well there is a regard for Sat and Sun,
Let me give you an example.

Lets say that we start the job on Thursday and work 10 hours. The employee would have 8 hours of regular time and then 2 hours of over time. More than likely we don't work on Sundays but sometimes we do so I have to count that time even if it = 0.

Friday and Saturday we work 8 hours, now the employee gets paid for 24 reg. hours and 2 hours of OT.

The down side to all this is I need 2 versions of this math.

(v1)Temp employees earn a MAX of 8 reg hours a day with anything over 8 being overtime. Once the employee reaches 40 regular hours everything worked after that is considered overtime.

(v2)Company Employees work any amount of hours a day and don't hit overtime until they hit a total of 40 hours. Everything after 40 is considered overtime.

In most cases we work Mon - Sat 10 hours a day.
 
Upvote 0
If I understand your overtime policy correctly, a person earns premium pay for any hours over 8 in a single day and any time over 40 in a week with no special regard for Saturday or Sunday. If this is incorrect, repost more detail about your policy and I can try to make adjustments.

Try the below and see if you get the results you are seeking.

For cell H43: =IF(SUM(C43:G43)<40,MIN(40-SUM(C43:G43),H40),0)
For cell I43: =IF(SUM(C43:H43)<40,MIN(40-SUM(C43:H43),I40),0)
For cell H44: =SUM(H14:H40)-H43
For cell I44: =SUM(I14:I40)-I43

Okay using those formula's give the employee 10 hours of work on W, T, F and S and watch what happens.
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,334
Members
452,907
Latest member
Roland Deschain

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