Notifications
Clear all
General Excel Questions & Answers
3
Posts
2
Users
0
Reactions
113
Views
Topic starter
In the attached file, I need to check if the employee has 36 hours of rest -
Line 4 has the entry time + previous exit time - I need to check if the difference between the 2 dates
is greater than or equal to 36 hours = if so it should be written yes and vice versa no.
Thanks for the help, Leah
Posted : 03/07/2023 7:48 am
Topic starter
I entered a formula in cell I4. The problem is that it gives a no result,
in a situation where there is a difference of 36 hours, why??
Posted : 03/07/2023 8:06 pm
I believe you are over-complicating the matter. The formula in I4 can be as simple as:
=IF((G4-H4)*24>=36,"Yes","No")
No need to use MOD in this type of calculation since you are comparing an ending DateTime that is always after the starting DateTime. Subtract the two and multiply by 24 to get the number of hours between them.
MOD comes into the picture when you need to be able to calculate, for instance, the number hours between to times where the starting time is before midnight and the ending time is early the next morning. A simple (End - Start) would then result in negative time ######. Then, MOD(End - Start, 1) will handle that.
Posted : 04/07/2023 1:17 am