+ Reply to Thread
Results 1 to 2 of 2

Detecting whether a time falls within a military time range

  1. #1
    Registered User
    Join Date
    03-18-2007
    Location
    Port Washington, WI, USA
    MS-Off Ver
    2013
    Posts
    10

    Detecting whether a time falls within a military time range

    Dear forum,

    I'm having trouble detecting whether a user-specified time falls within a military time range. I have been trying to accomplish this with the following formula, but I keep having problems:

    Please Login or Register  to view this content.
    Please also see the image associated with this:

    Thanks!
    btorrean
    Attached Images Attached Images
    Last edited by btorrean; 03-19-2007 at 07:55 AM. Reason: Added info

  2. #2
    Forum Contributor
    Join Date
    02-23-2005
    Location
    England
    Posts
    110
    Try this modified version:

    =IF(OR(AND(S4<=R4,S4>=Q4,R4>=Q4),AND(S4<=R4+24,S4>=Q4,R4<Q4),AND(AND(S4>=Q4,NOT(S4<=R4)),AND(NOT(S4>=Q4),S4<=R4))),TRUE,FALSE)

    (What you appeared to be doing wrong is not accounting for the fact that 00:15 is not greater than a time before 24:00 - hence the changes given above.)

+ 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