Sure, generally one intersects two intervals by doing something like: ```py inter_start = max(bucket_start, time_start) inter_end = min(bucket_end, time_end) inter_time = max(0, inter_end - inter_start) ```
Ah, that makes more sense - I've done something similar in Excel in fact - MAX(0,MIN(T_1,end-INT(end)+(start-INT(start)>end-INT(end)))-MAX(T_0,start-INT(start)))