that 560 value in col F is caused by adding 24 days to the value.
change the formula to
and it will give you 8 hours as it is supposed to.
Times are a fraction of 1 1 hour is in decimalvalue 0,04166666667 24 hours in decimal 1
when endtime is smaller then begin time your old formula caused a calucations of 1*24 = 24 is 24*24 hours = 576 hours - (23:00-7:00=16 hours) = 560 hours
combined with the formaterror it gives you strange results
You have been struggling with 2 errors (in format and in formula) that by chance displayed the expected value.
In your file I have made some calculations and formats to show you the effect. hop that will help you understand the challenges of calculating with time in excel.
Bookmarks