Closed Thread
Results 1 to 2 of 2

Check if a current time falls in a time range after midnight

  1. #1
    Registered User
    Join Date
    07-23-2019
    Location
    Sweden
    MS-Off Ver
    Version 1906
    Posts
    1

    Check if a current time falls in a time range after midnight

    Hi! I'm having serious issues with this one and if someone could help me that would be very appriciated!
    I'm trying to do an excel function to say if a current time falls between two times. The problem I'm having is if the end time runs after midnight. If I have the current time in B4, start time in B5 and end time in B6, I have been using =if(and(B4>=min(B5:B6);B4<=max(B5:B6))) which is not working if for example B4=00:30, B5=23:30 and B6=02:00. I know it's because Excel doesn't understand it's 02:00 the day after and I've been trying with if-functions to add an extra 24 hours to the end time if the end time is smaller than the start time, but nothing works.
    If anyone has an answer to this it would be soo appriciated!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Check if a current time falls in a time range after midnight

    You have already been told not to open duplicate threads. Creating a new user profile and posting again is no different.

    You may continue here with the identical query: https://www.excelforum.com/excel-gen...-midnight.html

    You can bump the thread if you need to, but please do not try to circumvent our rules. I will ask an administrator to close this new account - continue with the old one, please. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 07-23-2019, 05:17 AM
  2. Replies: 12
    Last Post: 11-11-2018, 08:41 AM
  3. [SOLVED] Want to extract time before and after midnight for a time range that spans midnight
    By schurchill39 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-26-2018, 04:18 PM
  4. Replies: 2
    Last Post: 06-26-2018, 09:10 PM
  5. [SOLVED] Check if range of time falls in another range of time
    By wafs in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-18-2018, 06:47 PM
  6. [SOLVED] Counting values in a time range - when the time range crosses midnight
    By dlocos in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-24-2014, 04:27 AM
  7. Adding 10 minutes to current time - issue at midnight
    By thorne_ in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 05-11-2009, 12:09 PM

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