Finding if times fall within a specific hour window



I have been trying to figure out a formula where a time falls within an 8 hour window.

For example: I am trying to calculate the time data was collected and the time the test was administered falls within an 8 hour window.



Selected Answer

If it's a simple time during the day, you can use the hour function combined with an IF statment.

=IF(HOUR(A2)-HOUR(A1)<=8,"Within 8 hours.","NOT within 8 hours.")

Cells A1 and A2 should be the times and they must be in an Excel date/time format in order to work.



Ah! Thank you so much! I couldn't not figure out how to write out the "8 hour window." And it's obviously written as it's spelled out... lol

Thank you again!
arexniba (rep: 2) Mar 6, '17 at 4:32 pm
Add to Discussion

Answer the Question

You must create an account to use the forum. Create an Account or Login