A formula in a single cell can do this too. For the 15 minute intervals, in cell D3:
=IF((D$1:CV$1>=$A3:$A5)*(ROUND((D$1:CV$1+1/96),8)<=ROUND($B3:$B5,8)),1,"")
which will spill into rows and columns, and should update itself when times change in columns A & B.