+ Reply to Thread
Results 1 to 24 of 24

Adding 10 minutes to current time - issue at midnight

Hybrid View

  1. #1
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Adding 10 minutes to current time - issue at midnight

    No doubt I sound like a bore but can you explain each cell - I can't make head nor tail of it I'm afraid...

    Re:
    G5: =ROUND(FLOOR(NOW()+"00:10","00:05"),0)

    By Rounding to 0 decimals you are dispensing with Time altogether and using only a Day value. In XL dates are Integers and Time is Decimal... ie Noon on 11th May = 39944.5
    (the above value for today noon assumes 1904 Date System in Use)

    If you round to nearest whole number (ie 0) you dispense with time... going back to your original point re: 13th May ... if the time portion of the value pre-rounding was >= noon you will end up rounding up to the next day given 0.5 (noon) will round to 1 where 1 equates to 1 entire day... if the time were < noon then it would round down to 00:00 of the same day.

  2. #2
    Registered User
    Join Date
    05-11-2009
    Location
    dublin,ireland
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Adding 10 minutes to current time - issue at midnight

    Hi,

    the reason i used round is because i only need to get the day to use. Try using it without the round in there, it goes crazy!

    The original code wasn't written by me (i just have to attempt to fix the error)
    so i'm not 100% on it either

    I'm not sure about the reference to '<=0.999988426' but im assuming it denotes midnight of something along those lines. The other logical test in the formula i have adjusted - it is simply a test to ensure that the update time is in the past. If both these are true we add one day and use this as our day value in the second formula.

    Hope this clears it up a bit

    edit : 0.999988426 = (11:59:59 P.M.)
    Last edited by thorne_; 05-11-2009 at 09:10 AM.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Adding 10 minutes to current time - issue at midnight

    As advised don't use ROUND use INT to extract the date of the datetime value given the former will actually increase the day by 1 whenever the time portion of the datetime value is greater than or equal to noon.

    Consider: X is 39944.5 (11th May Noon)

    ROUND(X,0) --> 39945 --> 12th May
    INT(X) --> 39944 --> 11th May

  4. #4
    Registered User
    Join Date
    05-11-2009
    Location
    dublin,ireland
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Adding 10 minutes to current time - issue at midnight

    thanks, however there is still an issue from 23.49.59 to 23.54.59 where it jumps to 13th may!

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Adding 10 minutes to current time - issue at midnight

    I'm afraid I'm going to have to bow out as I'm finding it impossible to follow what it is you're doing / trying to do. Perhaps a fresh set of eyes will help.

  6. #6
    Registered User
    Join Date
    05-11-2009
    Location
    dublin,ireland
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Adding 10 minutes to current time - issue at midnight

    ok - thanks for your help

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

    Re: Adding 10 minutes to current time - issue at midnight

    Maybe =CEILING(A1+"0:05", "0:05")
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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