Using Mikeopolo's setup just change the E5 formula to this

=IF(OR(TIME(E$2,0,0)>=$D5,TIME(E$3,0,0)<=$C5),0,1)

copy across and down