+ Reply to Thread
Results 1 to 24 of 24

Adding 10 minutes to current time - issue at midnight

Hybrid View

  1. #1
    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

    no - these are embedded within cells

  2. #2
    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 not entirely sure I follow... but

    B2: =MOD(FLOOR(A2+"00:10","00:05"),1)

    Where A2 holds time to which 10 minutes are added, the prior 5 minute point will be returned... the MOD will handle the midnight issue... ie if A2 is 23:56 B1 would return 00:05

  3. #3
    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 for your reply, but it wont return the correct date-time will it?

    eg using todays date (11 may) at 23.51 it should return '2009-May-12 00:00:00'

    and does but at 23.55 it returns '2009-May-11 00:00:00'

    which is a problem

  4. #4
    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

    It's still difficult for me at least to visualise your setup... if you're trying to find the last 5 minute period for NOW + ten minutes then:

    =FLOOR(NOW()+"00:10","00:05")

    (NOW() is a DateTime value so you merely need to add ten minutes to it and adjust thereafter - the result of which will equally be a DateTime value, the Day portion will adjust as it crosses midnight)
    Last edited by DonkeyOte; 05-11-2009 at 07:23 AM.

  5. #5
    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

    again thanks for your reply, that works for 23.55 - 00.00 but before that (from 11.50) it returns one day too much

    eg @ 23.51 it return 2009-May-13 00.00.00

  6. #6
    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

    post a sample file... I can't comprehend how you're getting 13th May based on NOW() + 10 mins.

  7. #7
    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,

    I attached a sample - the left values are yours, the right values are what is there currently.

    i replaced several parameters with constants and made the updatetime = now()
    Attached Files Attached Files

+ 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