Home
Portfolio
Code Library
back to list
Calculate time difference crossing midnight
This formula will help you calculate the hours difference between two times, even when the end time crosses midnight (Ex 7pm - 2am)
Excel
The error code was added in case someone puts a non-date or numerical value in one of the input cells.
=IFERROR((IF(B2<A2,(B2+1)-(A2),(B2-A2)),0)
Written by fbrefere001
Posted by fbrefere001 on Sunday August 7, 2016