Try =IF(I1="","",MAX(0,MIN(39/48,I1)-MAX(2/3,H1)))
Instead of fractions, you could use Time(19,30,0) for 7:30 and Time(16,0,0). I use fractions only because it's easy for me to think in terms of fractions and I like short formulas.
An IF formula has three parts, the logical test, the value if true, and the value if false. If I1 is blank, this formula will return a blank, otherwise it will calculate the value. Max just takes the largest value in a given list. Putting Max(0,<rest of formula>) in makes it read as 0 if the value is negative. Min is simply the opposite.
Bookmarks