I am trying to find the correct excel formula to use: I have 2 cells that contain a start time [cell E2] and an end time [cell F2]. I want to calculate how many hours there are between the timeframe of 00:00 and 08:00 based on those start and end times. I have found a formula that works:
=IF((E2*24)<8,8-(E2*24),IF((F2*24)<8,F2*24,""))
However the formula will be exported into excel using this identical formula across every row, therefore I am unable to specify rows only columns to calculate each row of the worksheet correctly.
I then found one formula that works to calculate the hours after 00:00 only, referencing only the end time time in column F:
=SUM(INDIRECT(ADDRESS(ROW(),6))*24)
and one formula to calculate hours before 08:00, referencing only the start time in column E:
=SUM(8-(INDIRECT(ADDRESS(ROW(),5))*24))
I would like to find a way to combine the last two formulas to achieve the same result from the first formula I used when I specified the cells to be used. Can anyone help? Any suggestions would be appreciated in achieving this or any other alternative solution.
Bookmarks