+ Reply to Thread
Results 1 to 3 of 3

Is this date and time calculation possible?

  1. #1
    Registered User
    Join Date
    07-30-2012
    Location
    Washington DC
    MS-Off Ver
    Excel 2010
    Posts
    8

    Is this date and time calculation possible?

    Ok so I've seen many posts on calculating the difference between two dates and I've seen some on two times however I need to calculate the total day/hours/minutes between two cells. For Example:

    C2 contains the value "7/2/2012 15:40" and D2 contains the value "7/6/2012 9:30" and I need to calculate the day/hour/minute difference between the two... Is this something that is possible in Excel? Lastly after I get that, then I need to get the average of day/hour/minute from all the returned value is that possible also? I'm completely stumped on this one. Thanks in advance for any effort in helping me figure this out.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,814

    Re: Is this date and time calculation possible?

    All you need to do is subtract one from the other, i.e.:

    =D2-C2

    and then apply a custom format to the cell of [hh]:mm - the square brackets around the hours prevent it from wrapping at 24 hours, so you get the answer in hours and minutes.

    Hope this helps.

    Pete

  3. #3
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Is this date and time calculation possible?

    Yes

    The Excel will easily subtract between two dates. A simple equation =D2-C2 will work. If you need something like you described, this formula will work:

    =INT(D2-C2)&" days "&INT(((D2-C2)-INT(D2-C2))*24)&" hours "&FIXED(((((D2-C2)-INT(D2-C2))*24)-INT(((D2-C2)-INT(D2-C2))*24))*60,0)&" min"

    Averaging should be straightforward if you leave the result in days
    Click on star (*) below if this helps

+ 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