+ Reply to Thread
Results 1 to 4 of 4

Difference between 2 x d/mm/yyyy h:mm cells

  1. #1
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    209

    Difference between 2 x d/mm/yyyy h:mm cells

    Hi guys,

    Hope someone can help with this, ive been trying to INT,MOD and format options though cant get it how i want it too..

    Basically i have 2 dates formated in d/mm/yyyy h:mm

    I.e.
    9/04/2010 12:16:31 PM & 20/04/2010 5:45:22 PM


    I want to be able work out in 1 cell the time difference between the 2 dates\times... something to the effect of "11days, 5 hours": using the above example

    The end result will be to be able to put the data into a pivot table.
    Last edited by SarahPintal; 06-16-2010 at 12:56 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Difference between 2 x d/mm/yyyy h:mm cells

    Perhaps

    =INT(B1-A1) &" days " &ROUND( MOD(B1-A1,1)*24,0) & " Hours"

    this'll round the hours.. if you don't want to, then:

    =INT(B1-A1) &" days " &INT( MOD(B1-A1,1)*24,0) & " Hours"
    Last edited by NBVC; 06-15-2010 at 10:56 PM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Difference between 2 x d/mm/yyyy h:mm cells

    =B1-A1, formatted as d"days "h"hours"
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    209

    Re: Difference between 2 x d/mm/yyyy h:mm cells

    Thanks gents,
    NBVS's formula did the trick...


    I did try the =B1-A1, formatted as d"days "h"hours" before i posted this thread though couldnt get it to work.

    In any event, it works

    Thanks as always!

+ 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