+ Reply to Thread
Results 1 to 4 of 4

date time calculations - elapsed time

  1. #1
    Registered User
    Join Date
    07-11-2011
    Location
    boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    2

    date time calculations - elapsed time

    I have been reading the posts here and have made great progress. Getting the correct elapsed time to display will either work for instances under 24 hours or orver, but I can't get both to happen with the same formula.

    Currently using this:
    =INT(b2-a2) & " days " & TEXT(MOD(b2-a2,1),"[h]:mm:ss")

    I cannot change the date system to 1904, so I'm getting a negative number for the days. Additionally, for time that has elapsed that is less then 24 hours, the days value is still -1 (rather then 0). Time appears to be calculating fine. Time elapsed over 24 hours, the days seem to be correct, but a negative value.

    Does anyone have a suggestion for getting the days to calculate properly? I have attached a sample of the data I'm using.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: date time calculations - elapsed time

    I think you have your Bs and Cs mixed up in your formula. Try:

    =INT(B2-C2) & " days " & TEXT(MOD(B2-C2,1),"[h]:mm:ss")

  3. #3
    Registered User
    Join Date
    07-11-2011
    Location
    boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: date time calculations - elapsed time

    Yep, that was it!

    Thank you brokenbiscuits!

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

    Re: date time calculations - elapsed time

    MOD function isn't required - this would be sufficient

    =INT(B2-C2) & " days " & TEXT(B2-C2,"h:mm:ss")
    Audere est facere

+ 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