Forum Discussion
Need help calculating the difference between two dates and times
- Dec 01, 2022
HassaanAhmed Calculating with dates and times like this is tricky. you need to introduce the MOD function to take only the decimal part of the date.time value.
By the way, I prefer to calculate with the TIME function when adding hours. See attached.
Note also that the 00:00 hour should always be the last hour for the day. On row 14 you had this hour on September 1.
HassaanAhmed You would build a formula like:
=(Date1+Time1)-(Date2+Time2)
It doesn't require the dates and times to be merged in the same cell to do this calculation.
Riny_van_EekelenThanks. I tried doing that already, but the result flips after 12 pm.
As you can see below, the time difference between the two times should still be -12 even after 12 pm, but it doesn't pick it up that way.