You can use this array formula in E2
=1440*SUM(IF(C$2:C$4 >B2,0,IF(D$2:D$4<A2,0,IF(D$2:D$4 >B2,B2,D$2:D$4)-IF(C$2:C$4< A2,A2,C$2:C$4))))
<a2,0,if(d$2:d$4><a2,a2,c$2:c$4))))
<a2,0,if(d$2:d$4><a2,a2,c$2:c$4))))
confirmed with CTRL+SHIFT+ENTER and copied down
You won't get exactly the results you suggest because the "End Day" periods end at a minute to midnight - if you want to get the results 90 and 910 then change B2 to 10/5/2017 00:00 and B3 to 10/6/2017 00:00</a2,a2,c$2:c$4))))
</a2,0,if(d$2:d$4></a2,a2,c$2:c$4))))
</a2,0,if(d$2:d$4>