+ Reply to Thread
Results 1 to 3 of 3

calculate duration of hours

  1. #1
    Registered User
    Join Date
    09-29-2008
    Location
    california
    Posts
    5

    calculate duration of hours

    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
    Attached Files Attached Files
    Last edited by VBA Noob; 11-09-2008 at 11:36 AM.

  2. #2
    Registered User
    Join Date
    10-12-2008
    Location
    Maldives
    MS-Off Ver
    MS 2010
    Posts
    59
    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????

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    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)

    Please Login or Register  to view this content.
    Apply a custom format to cell P6 of [h]:mm

    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1