tryingmybest418
New Member
- Joined
- Jan 22, 2018
- Messages
- 32
Hi all,
I am trying to write a macro that checks if a timestamp from an event falls between a series of two other time stamps.
There is a timestamp in cell B2 and if it falls between the timestamps in G2 & H2, or G3 & H3, or G4 & H4 etc... I would like A2 to display "ERROR"
The macro can stop running if any of the ranges throw "ERROR".
It would ideally check something along the lines of:
IF (date/time) in B2 is greater than (date/time) in G2 and less than (date/time) in H2, then A2 = "ERROR"
IF NO ERROR THEN
IF (date/time) in B2 is greater than (date/time) in G3 and less than (date/time) in H3, then A2 = "ERROR"
IF NO ERROR THEN
IF (date/time) in B2 is greater than (date/time) in G4 and less than (date/time) in H4, then A2 = "ERROR"
And run until there is no value in column H.
All of the date/time values are in the format:
08/24/2018 10:17:10 AM
Thanks in advance!
I am trying to write a macro that checks if a timestamp from an event falls between a series of two other time stamps.
There is a timestamp in cell B2 and if it falls between the timestamps in G2 & H2, or G3 & H3, or G4 & H4 etc... I would like A2 to display "ERROR"
The macro can stop running if any of the ranges throw "ERROR".
It would ideally check something along the lines of:
IF (date/time) in B2 is greater than (date/time) in G2 and less than (date/time) in H2, then A2 = "ERROR"
IF NO ERROR THEN
IF (date/time) in B2 is greater than (date/time) in G3 and less than (date/time) in H3, then A2 = "ERROR"
IF NO ERROR THEN
IF (date/time) in B2 is greater than (date/time) in G4 and less than (date/time) in H4, then A2 = "ERROR"
And run until there is no value in column H.
All of the date/time values are in the format:
08/24/2018 10:17:10 AM
Thanks in advance!