Hi,
I have a spreadsheet that I use to calculate attendance hours for a course we run in my organisation. As the session is a drop in this means that start times are erratic.
I created a simple spreadsheet that uses time formatted as [h]:mm. The columns are: Start, End, Lunch, Total Hrs, Total Hrs (dec).
The problem I am having is that I have a formul in the lunch column. Lunch is between 12-1pm. So I wanted a formula to automatically calculate the lunch break based on the start time. So basically any start time up to 12:00 and the lunch break will be 1:00. However if the start time is 12:01 then the lunch break will be 0.59 and say the start time is 12:50 then the lunch break will be 0:10. The reason for this is as the class doesn't resume until 1pm we don't want to count any time between 12pm and 1pm.
I used a formula in the Lunch column which appears to work ok which is:
Note:A2=Start Time, B2=End Time![]()
Please Login or Register to view this content.
In the IF formula I had to use decimal for time as I didn't know how to use actual time in an IF statement or if it were possible.
Dec Time
0.5 12:00
0.042 1:00
0.5416 12:59
0.5417 13:00
This is probably not the most elegant formula but what it does is: The first IF statement checks for start times before 12 noon and the 2nd IF statement for times greater than or equal to 1pm and calulates the lunch break accordingly.
The problem arises in columnd D Total Hrs. Again this is formatted [h]:mm and the formula seems to take 1 minute off the correct calulation. For example: If the Start time is: 10:45 then and the End time is:16:00, the the total time should be: 4:15, howerver the formula below shows 4:14.
This in turn affects the formula in column E which converts the total time in column D to a decimal value, formula:![]()
Please Login or Register to view this content.
I would be grateful if one of the Excel Gurus here could advise me on the best way to create a formula that will automatically calculate the lunch break based on start time and then calculate the total time minus the lunch break time.![]()
Please Login or Register to view this content.
Many thanks.
Bookmarks