+ Reply to Thread
Results 1 to 7 of 7

Total Time Calculation

  1. #1
    Registered User
    Join Date
    06-29-2011
    Location
    Tampa Florida
    MS-Off Ver
    Excel 2003
    Posts
    4

    Question Total Time Calculation

    I am trying to calculate total time worked from 5 PM to 7 AM with no breaks. I have already tried the following formula but it does not fit the need over midnight.
    =IF((D57-C57)*24)>8,8,((D57-C57)*24))

    Column D start time Column C end time
    Please Help
    Last edited by acastell; 06-30-2011 at 09:39 AM.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,317

    Re: Total Time Calculation

    Hello & Welcome to the Board,

    Could this be what you need...

    =IF(MOD(E57-D57,1)>TIME(8,0,0),TIME(8,0,0),MOD(E57-D57,1))

    You can format as [h]:mm

    Quote Originally Posted by acastell View Post
    I trying to calculate total time worked from 5 PM to 7 AM with no breaks. I have already tried the following formula but it does not fit the need over midnight.
    With the formula you had, why are you returning 8 hours with anything greater than 8 hours but you say you want to calculate time from 5 PM to 7 AM?
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    06-29-2011
    Location
    Tampa Florida
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Total Time Calculation

    Quote Originally Posted by jeffreybrown View Post
    Hello & Welcome to the Board,

    Could this be what you need...

    =IF(MOD(E57-D57,1)>TIME(8,0,0),TIME(8,0,0),MOD(E57-D57,1))

    You can format as [h]:mm



    With the formula you had, why are you returning 8 hours with anything greater than 8 hours but you say you want to calculate time from 5 PM to 7 AM?
    Unless I'm doing it wrong, no this is not it. If E57 is time punched out and D57 is time punched in, than this formula returns .3333333 or formatted in [h]:mm it returns 8:00. Sorry I don't think this is it. It should total 14.00. Thanks Jeff

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,317

    Re: Total Time Calculation

    =mod(e57-d57,1)

  5. #5
    Registered User
    Join Date
    06-29-2011
    Location
    Tampa Florida
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Total Time Calculation

    Quote Originally Posted by jeffreybrown View Post
    =mod(e57-d57,1)
    Jeff thanks but this almost gets me there. I have attached a sample spreadsheet. I have some people working am to pm and some working pm to am. The formula you sent works for pm to am and not for am to pm. If you could look one more time I would really appreciate it
    AJ
    Attached Files Attached Files

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Total Time Calculation

    Jeff's formula works for me if you want to see result in time format like 14:00, e.g. in D3 use this formula

    =MOD(C3-B3,1)

    format as h:mm and copy down. Make sure you format the total cell (D10) as custom [h]:mm (note the square brackets) otherwise you won't get the right total

    If you just want to see 14 then multiply by 24, i.e. use this formula instead

    =MOD(C3-B3,1)*24

    format cells as general
    Audere est facere

  7. #7
    Registered User
    Join Date
    06-29-2011
    Location
    Tampa Florida
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Total Time Calculation

    Thank you daddylonglegs! This is the complete solution.
    My headache is now gone! - AJ

+ 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