Forum Discussion
tomvermaas
Sep 02, 2023Copper Contributor
Calculate downtime
Hello all, I am looking for help. I would like to calculate the downtime of a machine in Excel. for this I need the difference in minutes between the start time and stop time. The only excep...
- Sep 02, 2023
This is a 365 solution. I've created a function called Downtime.
Downtime(Start,Stop) =LET( Min_in_day, 1440, one_minute, 1 / Min_in_day, TotalMinutes, LAMBDA(begin, end, LET( duration, (end - begin) * Min_in_day, TotalTime, SEQUENCE(duration, , begin, one_minute), hr, TotalTime - INT(TotalTime), Actual, FILTER( TotalTime, (WEEKDAY(TotalTime, 2) < 6) * (hr >= 6 / 24) * (hr < 23 / 24), 0 ), SUM(SIGN(Actual)) ) ), MAP(start, stop, TotalMinutes) )
javier04
Jul 23, 2026Copper Contributor
Great solution from PatrickZ788! The LAMBDA approach handles the Monday-Friday exception cleanly.
One thing worth adding — before building out the full formula, it helps to manually verify a few of your downtime calculations first using a simple Calculadora Alicia to confirm your expected minute differences are correct. That way you can validate the formula output against known values during testing saves a lot of debugging time when working with time-based calculations in Excel.