Hi All, I'm trying to create a work sheet with start and ending times with a 30 minute meal break, for the end of the week I would like to calculate those hours as a general number. Thank you in advance
Hi All, I'm trying to create a work sheet with start and ending times with a 30 minute meal break, for the end of the week I would like to calculate those hours as a general number. Thank you in advance
Last edited by VBA Noob; 11-09-2008 at 11:36 AM.
I guess just 11 will NOT read as a time so you have to write 11:00
and to my knowledge it SHOULD NOT be 7:30 it should be 19:30
so to sum-up the total hrs do the following
=(C7-B7)+(E7-D7)+(G7-F7)+(I7-H7)+(K7-J7)+(M7-L7)+(O7-N7)
got right????
I agree with prior post that your time entries in each cell must be time values -- 11 is not valid -- should be entered either as 11:00 for AM or 23:00 for PM (or 11:00 PM), you can format the cells however you wish for the time to be displayed but the underlying values must be time based.
Assuming you have corrected entries the "In" entries accordingly the following should return the correct result (40 hours assuming In is 23:00 and Out is 07:30 -- 42hr 30 mins less 5 x 30 min breaks)
Apply a custom format to cell P6 of [h]:mm![]()
Please Login or Register to view this content.
If you wanted this returned as a decimal -- say answer was 42h 30m and you wanted displayed as 42.5 you would multiply the above answer by 24 and format cell to general (or decimal) - eg =24*SUMPRODUCT(...)
Last edited by DonkeyOte; 11-09-2008 at 09:38 AM. Reason: correction required to SUMPRODUCT re: 30 minute intervals
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks