+ Reply to Thread
Results 1 to 3 of 3

Calculate the difference in hours between two dates?

  1. #1
    Registered User
    Join Date
    12-14-2011
    Location
    Gothenburg, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    2

    Calculate the difference in hours between two dates?

    Hi,

    I'm a beginner, so please be gentle.

    I want to be able to calculate the difference in hours between two dates/times.

    For example:
    A1: 2011-12-12 12:00 B1: 2011-12-13 14:00
    When I do a simple substraction in C1 (=B1-A1), it doesn't include the dates, so the result i 2 hours.
    But I want it to be count both the 24 hours between the dates, and the hours: 26 hours.

    I found a similar thread from 2008, where the code =INT(B1-A1)&TEXT(B1-A1,":hh:mm") were used.
    But I didn't work for me.

    So anyone who could help me with this?

    Thanks in advance!

    /Jon, Sweden
    Last edited by Jonblomberg; 12-14-2011 at 09:45 AM.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Calculate the difference in hours between two dates?

    Hi and welcome to the board

    Try = B1-A1 and custom format as [h]:mm:ss

  3. #3
    Registered User
    Join Date
    12-14-2011
    Location
    Gothenburg, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Calculate the difference in hours between two dates?

    Oh, that was easy
    Thank you so much for your quick help!

    /Jon

+ 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