Calculation help

A

Arul

I'm working on a timesheet form. This timesheet is for two weeks. There's a
summary at the bottom of the timesheet that shows the total regular hours for
two weeks, total OT for two weeks, etc. Regular hours for a week is 40
hours. If say for example, hours worked for week1 is 43 and hours worked for
week2 is 40, then the regular hours in the summary section should show 80
hours and OT should show 3 hours. Similarly if hours worked for week1 is 30
and hours worked for week2 is 41, then the regular hours in the summary
section should show 71 hours and OT should show 0 hours. This is where I
have the problem. Currently, I'm adding the total hours in week1 and week2
and showing it as Regular hours. This is obviously incorrect. Since it
would involve some sort of case statement I'm not sure how it can be done.
Can someone please help?
 
V

Vaibhav

Hi Arul

If you know the total hours in a week has to be 40 then

TotalHours=hrsWeek1+ hrsWeek2
OT Hours=TotalHours-80
If OTHours<0 Then
OTHours=0
End If

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top