+ Reply to Thread
Results 1 to 12 of 12

Calculate Time Difference

  1. #1
    Registered User
    Join Date
    02-09-2011
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    87

    Calculate Time Difference

    How can I extract the time difference between two Cells
    Like

    9/2/2011 10:35 9/2/2011 1:35

    I need to show the time and day, but on the third cell say A3 it shows the time difference !

    Oceans Blue

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

    Re: Calculate Time Difference

    Assuming that is 10:25 AM and 1:35 PM

    and they are in A1 and B1, respectively, try:

    =(B1-A1)*24

    gives number of hours difference.
    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
    Registered User
    Join Date
    02-09-2011
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: Calculate Time Difference

    Here is the exact format I have it in

    9/2/2011 10:35 9/2/2011 1:35

    Date and Time

    I tried your formula, result is 9

    Do i need to keep the date in a separate cell?

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Calculate Time Difference

    Will the day always be the same in A1 and A2? If not, which day do you want to show in your result? Okay, saying that A1 < A2, try with cell formatted the same as A1 and A2;

    =INT(A2) + (A2-A1)
    Does that work for you? You're mixing up dates and time (as in on a clock) with time as a difference (hours and minutes) so not sure why you still want the day in your result.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

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

    Re: Calculate Time Difference

    no dates don't need to be in different cells... but if you click on those cells, what do you see for each in the Formula Bar up top?

  6. #6
    Registered User
    Join Date
    02-09-2011
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: Calculate Time Difference

    I'll take that back.

    This 9/2/2011 1:35 was at AM

    When I switched it to PM it gave me 3 hours, which is correct.

    Thanks

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

    Re: Calculate Time Difference

    Don't forget to please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  8. #8
    Registered User
    Join Date
    02-09-2011
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: Calculate Time Difference

    I 'll take that back.....

    Not 100% working for me.

    Down Time Log
    Ticket # Created Deploy Down For in hours

    ENRQIII-169 8/31/2011 12:48 9/1/2011 18:37 PM #VALUE! =(E5-D5)*24
    ENRQIII-170 8/31/2011 15:54 9/1/2011 17:30 25.60
    ENRQIII-171 9/1/2011 13:10 9/1/2011 14:10 1.00
    ENRQIII-172 9/1/2011 14:45 9/1/2011 16:50 2.08
    ENRQIII-175 9/2/2011 8:00 9/2/2011 10:30 2.50
    9/2/2011 10:35 9/2/2011 13:35 3.00

    #VALUE!

    I am trying to calculate the time difference , as you can see the first one is not showing the correct out put !

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

    Re: Calculate Time Difference

    The #VALUE means to me you have a text entry in either D or E or both. Double check those

  10. #10
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Calculate Time Difference

    The 18:37 PM is being seen as text. Remove the PM (it's redundent)

  11. #11
    Registered User
    Join Date
    02-09-2011
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: Calculate Time Difference

    Perfect,

    You were right

    Down Time Log
    Ticket # Created Time Compl. / Deploy Time Down For in hours

    ENRQIII-169 8/31/2011 12:48 9/1/2011 17:30 28.70

    Now is it possible to get the total only between business hours. Say from 8:30AM to 5:30PM?

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

    Re: Calculate Time Difference

    Our very own daddylonglegs has a post here that should help:

    http://www.ozgrid.com/forum/showthre...t=87732&page=1

+ 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