Results 1 to 3 of 3

Checking for time overlaps against given points in the day

Threaded View

  1. #1
    Registered User
    Join Date
    07-26-2016
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    2

    Checking for time overlaps against given points in the day

    Hi all

    I have been trying to solve a problem using excel formulas but I think I need some VBA code to make the formula repeat - unfortunatly this is beyond my excel knowledge! I'd really appreciate some help, been stuck on this for a while now.

    The problem is as follows:

    There are several sensors which can exist in either two states; "Taken" or "Empty". The data I have gives me the Start and End Time of when a sensor is Taken. I'd like to evaluate the Start/End time for each "Taken" period against a specific time of day (a Reference Time). I will then repeat this for different Reference Times throughout the day. I will do this independently for each sensor and then analyse the end result to see how many of the sensors where taken at different points in the day.

    I have a formula which returns a response of "Taken" if the Start Time is less than (or equal to) the Referenced Time AND the End Time is greater than (or equal to) the Referenced Time. This is repeated for each Start and End Time against a given Reference Time. Independently for each sensor.

    =IF(AND((IF(AND($B$5<=K5,($K$5<=$C$5)),$B$5,(IF(AND($B$6<=$K$5,$K$5<=$C$6),$B$6,IF(AND($B$7<=$K$5,$K$5<=$C$7),$B$7,"end")))))<=$K5,$C$5>=$K5),"Taken", "Empty")

    Where K5 is the Reference Time
    B5 is the Start Time for the first registered "Taken" session, and C5 is the End Time for the first registered "Taken Session" (Sensor A)
    B6/C6... B7/C7 then repeats the process for each subsequent Start/End Time (Sensor A).


    The problem is I have up to 30-50 "Taken" session for each sensor each day, and I reach the character limit very quickly if I keep adding nested IF functions in this way.

    I need some code (?) to repeat the process of checking to see if the Start/End time overlaps with the Reference Time until all Start/End times have been exhausted.

    Thanks!!!
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help in checking for overlaps in time across sheets
    By TMartin79 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-15-2013, 03:42 PM
  2. Tracking Date and Time overlaps
    By kukarooza in forum Excel General
    Replies: 11
    Last Post: 10-11-2013, 09:09 AM
  3. Calculating Time Overlaps with Multiple Ranges
    By LAMFCU in forum Excel General
    Replies: 3
    Last Post: 07-03-2013, 04:40 AM
  4. Series of help: including if time overlaps
    By freeurmind in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2013, 06:32 AM
  5. Replies: 3
    Last Post: 05-25-2012, 03:41 PM
  6. Checking if time is between 2-4 hours after another time
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-28-2011, 12:58 PM
  7. Checking 1 time against 3 time ranges
    By clawton8 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-24-2011, 01:49 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