+ Reply to Thread
Results 1 to 6 of 6

Calculating differences in dates

  1. #1
    Valued Forum Contributor
    Join Date
    06-30-2005
    Location
    Verwood, Dorset, England
    MS-Off Ver
    Excel 2000
    Posts
    479

    Calculating differences in dates

    I want to calculate the difference between todays date and dates in the future in days, hours and minutes

    eg Today 30/06/2005 10:37
    Future date 03/07/2005 11:48

    Difference 3 days 1 hour 11 minutes

    What formula should I use and how should the cells be formatted?

    Thanks for any help

  2. #2
    Forum Contributor
    Join Date
    05-03-2004
    Location
    England
    MS-Off Ver
    2003 Excel
    Posts
    118
    Hi Paul,
    subtract NOW() from the future date

    custom format to

    dd" days ":hh" hours ":mm" minutes"

    There maybe a better way but this will work.

    HTH.
    Greg.

    "The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."

  3. #3
    Valued Forum Contributor
    Join Date
    06-30-2005
    Location
    Verwood, Dorset, England
    MS-Off Ver
    Excel 2000
    Posts
    479
    Hi Greg

    That worked ok for the example I gave, but when I use future dates that are months away I do not get the result I would expext

    eg

    Future Date 09/09/2005 08:54
    Now 30/06/2005 11:23

    Result 10:21:03

    The hours and minutes look ok but not the days??????

  4. #4
    Bob Phillips
    Guest

    Re: Calculating differences in dates

    Paul,

    Is this any good?

    =(INT(A1-TODAY())-(MOD(A1,1)-MOD(NOW(),1)<0))&" days
    "&TEXT(MOD(A1-NOW(),1),"hh:mm:ss")

    --
    HTH

    Bob Phillips

    "Paul Sheppard" <Paul.Sheppard.1rfp2h_1120125917.5871@excelforum-nospam.com>
    wrote in message
    news:Paul.Sheppard.1rfp2h_1120125917.5871@excelforum-nospam.com...
    >
    > I want to calculate the difference between todays date and dates in the
    > future in days, hours and minutes
    >
    > eg Today 30/06/2005 10:37
    > Future date 03/07/2005 11:48
    >
    > Difference 3 days 1 hour 11 minutes
    >
    > What formula should I use and how should the cells be formatted?
    >
    > Thanks for any help
    >
    >
    > --
    > Paul Sheppard
    > ------------------------------------------------------------------------
    > Paul Sheppard's Profile:

    http://www.excelforum.com/member.php...o&userid=24783
    > View this thread: http://www.excelforum.com/showthread...hreadid=383463
    >




  5. #5
    Valued Forum Contributor
    Join Date
    06-30-2005
    Location
    Verwood, Dorset, England
    MS-Off Ver
    Excel 2000
    Posts
    479
    Bob

    Thanks, that works fine

    Paul

  6. #6
    Bob Phillips
    Guest

    Re: Calculating differences in dates

    That is because the dd will only go up to 31, then it cycles back to 1. Been
    caught by that myself <vbg>

    --
    HTH

    Bob Phillips

    "Paul Sheppard" <Paul.Sheppard.1rfruc_1120129521.3682@excelforum-nospam.com>
    wrote in message
    news:Paul.Sheppard.1rfruc_1120129521.3682@excelforum-nospam.com...
    >
    > Hi Greg
    >
    > That worked ok for the example I gave, but when I use future dates that
    > are months away I do not get the result I would expext
    >
    > eg
    >
    > Future Date 09/09/2005 08:54
    > Now 30/06/2005 11:23
    >
    > Result 10:21:03
    >
    > The hours and minutes look ok but not the days??????
    >
    >
    > --
    > Paul Sheppard
    > ------------------------------------------------------------------------
    > Paul Sheppard's Profile:

    http://www.excelforum.com/member.php...o&userid=24783
    > View this thread: http://www.excelforum.com/showthread...hreadid=383463
    >




+ 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