+ Reply to Thread
Results 1 to 3 of 3

Difference between dates and time

  1. #1
    Registered User
    Join Date
    09-11-2010
    Location
    Queensland, Australia
    MS-Off Ver
    Excel 2007
    Posts
    10

    Difference between dates and time

    I have tried the following code =NETWORKDAYS(A2,B2)-1-MOD(A2,1)+MOD(B2,1)

    I have 2 dates and times eg.05/09/2010 07:00 (A2) and 11/09/2010 21:00 (B2) I need to caculate the time in days and hrs between the two dates eg. ( 6 days and 14 Hrs) would that be possible to write such an code, and if so could you please assist, the above code I think display minutes only-not sure.
    Many thanks in advance
    Last edited by jns; 09-11-2010 at 07:04 AM.

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

    Re: Difference between dates and time

    Hello jns, thanks for changing your thread title.

    The NETWORKDAYS formula is designed to count working hours/days only, for your example it looks like you want to count all the time. Try this formula

    =INT(B2-A2)&" days "&TEXT(B2-A2,"h:mm")
    Audere est facere

  3. #3
    Registered User
    Join Date
    09-11-2010
    Location
    Queensland, Australia
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Difference between dates and time

    Hi daddylonglegs

    Thanks for the code it works perfectly.



    Quote Originally Posted by daddylonglegs View Post
    Hello jns, thanks for changing your thread title.

    The NETWORKDAYS formula is designed to count working hours/days only, for your example it looks like you want to count all the time. Try this formula

    =INT(B2-A2)&" days "&TEXT(B2-A2,"h:mm")

+ 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