This formula will count the number of blank cells starting in the column that matches the time entered in $B$1 (rounded down to 10-minutes) and moving to the right.
$B$1
=XMATCH("*",OFFSET(D$1:CX$1,ROW()-1,XMATCH(FLOOR($B$1,"010"),D$1:CX$1)-1),2)-1