Please see if the workbook v10.4 can give some ideas.
However, I think it may be necessary to add a row ID
to each row. Is that possible with your true dataset?
Maybe it is possible just with using [Time].
[Time in Status] was calculated as:
[Total Time in Status] was calculated as:
WINDOW_SUM([Time in Status])/(60*24)
The Pill locations and Table Calculations are shown below.
275145time.twbx 142.5 KB