+ Reply to Thread
Results 1 to 11 of 11

How to calculate time difference

  1. #1
    Registered User
    Join Date
    08-22-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    48

    How to calculate time difference

    417:31:07 555:00:00 137:28:53
    336:52:20 186:00:00 ########


    =B1-A1, I tried this. But, in second row i am not getting the negative difference. Please help.
    Last edited by DeepakS; 09-16-2011 at 08:45 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,614

    Re: How to calculate time difference

    Try =MOD(B1-A1, 1)

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: How to calculate time difference

    Or =ABS(B1-A1)

  4. #4
    Registered User
    Join Date
    08-22-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: How to calculate time difference

    Hi zbor,

    I am getting result like this,

    417:31:07 555:00:00 17:28:53
    336:52:20 186:00:00 17:07:40

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,614

    Re: How to calculate time difference

    Format cell as [h]:mm

  6. #6
    Registered User
    Join Date
    08-22-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: How to calculate time difference

    Hi Andrew-R,

    It works. But i need negative sign.

  7. #7
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: How to calculate time difference

    OK... =IF(A1>B1,"-","") & TEXT(ABS(B1-A1),"hh:mm")

  8. #8
    Registered User
    Join Date
    08-22-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: How to calculate time difference

    Now its like this,

    417:31:07 555:00:00 17:28
    336:52:20 186:00:00 -06:52

  9. #9
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: How to calculate time difference

    D'Oh! Sorry, just me being stupid ... =IF(A1>B1,"-","") & TEXT(ABS(B1-A1),"[h]:mm")

  10. #10
    Registered User
    Join Date
    08-22-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: How to calculate time difference

    :-) Its working perfectly. Thanks a lot Andrew-R.

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

    Re: How to calculate time difference

    Note that if you switch to 1904 date system you can use just =B1-A1 and you'll see negative time values

    Office Button > Excel Options > Advanced > 1904 date system

    Note that if you apply this to a worksheet existing dates in that sheet will change
    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