In the example, A1 is the "in" hour and B1 the "out" hour.
As you know, XL stores dates as numbers, 1 day being 1. So one hour is 1/24 day
What the formula does is
1 Evaluate the diff B1 and A1 ( which is a number smaller then one provided the patient doesn't stay in bed more than 24 hrs)
2. Add 1 if the "out" hour is smaller than the "in" hour, thus taking care of the fact XL does not allow negative times or durations
Maybe post a sample of your data as example
Instead of the formula provided you can also use =mod(b1-a1,1)
Bookmarks