so I sorted out with the MOD function to calculate my worked hours where I used to start at XX PM/AM and finish at XX AM/PM where without the MOD function I could not calculate properly if I was starting like at 5PM and finish after midnight. Anyway, not it works properly if I finish working before midnight or after. But If I finish working exactly at midnight and put in the cell 12 AM value, it gives me as a result 0 using this formula: =IF(C41=0,0,(MOD((C41-B41)-D41,1))*24) But if I put as value 12 and press enter, it gives me the correct amount of worked hours, but it also changes the value to 12/01/1900 12:00:00 AM. Why is that? This is how the table is:
A B C D E F
Date Shift start Shift end Break Total x shift Total
1-Oct 5:30 PM 12:00 AM 6.5 19
2-Oct 5:30 PM 12:00 AM 6.5
4-Oct 12:00 PM 6:00 PM 6
And formulas are:
=IF(C41=0,0,(MOD((C41-B41)-D41,1))*24)
in every cell of E column.