+ Reply to Thread
Results 1 to 6 of 6

Monitor date and time range

  1. #1
    Registered User
    Join Date
    06-12-2012
    Location
    Belfast N.Ireland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Monitor date and time range

    Hi guys
    Need a formula to return a true or false response if the "current" date is within a time range between 14:00 and 06:30 - daily.


    Can anyone please help?

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

    Re: Monitor date and time range

    How about just setting up either row 1 or cell 1 (A1) to be green only when the current time is within that range? Does that sound like what you want?

    14:00 to 6:30
    so any time before 6:30 AM or after 2:00 PM?
    Last edited by ChemistB; 06-12-2012 at 02:45 PM.
    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

  3. #3
    Registered User
    Join Date
    06-12-2012
    Location
    Belfast N.Ireland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Monitor date and time range

    I think that would work.
    Its just that I also was wanting a comparison with the "true or false" return if say cell a2 contained 63
    ie if now() is between 14:00 and 06:30 AND A2=63 then . . .then cell could be blue.

    Please excuse that feeble attempt to explain this. Hope it makes sense to you?

    Thank you

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

    Re: Monitor date and time range

    Got it. The key is you want to strip the date off the NOW() function and just have the time (strangely MS didn't create a simple TIME function). Since days are represented by whole numbers;

    =MOD(NOW(),1) returns the current time. So, IF(OR(MOD(NOW(),1)<("6:30"*1),MOD(NOW(),1)>("14:00"*1)) returns a TRUE/FALSE
    NOW is volatile so will recalculate whenever the sheet recalculates but won't if the sheet is just sitting there.

  5. #5
    Registered User
    Join Date
    06-12-2012
    Location
    Belfast N.Ireland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Monitor date and time range

    Thank you so very much.
    Excel said the formula was missing a parenthesis but I found it.
    IF(OR(MOD(NOW(),1)<("6:30"*1)),MOD(NOW(),1)>("14:00"*1))

    It is delivering a False statement right now - I presume that will change to True at 6:30 a.m. tomorrow?

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

    Re: Monitor date and time range

    It should be TRUE between the hours of 12Midnight and 6:30 AM and between the hours of 14:00 and Midnight

+ 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