OK.
This returns the expected results.
There are two helper columns. Column E (cells E7 and E14 only) mark the changeover dates.
In column F this formula returns a contiguous range of repeating dates. It shortens the final formula. In F7 and filled down.
Formula:
=IF(E7="",F6,E7)
Then array enter this in C9 and fill down to C12.
Formula:
=IFERROR(INDEX(SMALL(IF($B$2:$B$5<=$F9,$C$2:$C$5),ROW($1:$4)),ROWS(9:$9)),INDEX(LARGE(IF($B$2:$B$5>=$F9,$C$2:$C$5),ROW($1:$4)),ROWS(9:$9)-COUNTIF($B$2:$B$5,"<="&F9)))
In C16 array entered as the previous
Formula:
=IFERROR(INDEX(SMALL(IF($B$2:$B$5<=$F16,$C$2:$C$5),ROW($1:$4)),ROWS($16:16)),INDEX(LARGE(IF($B$2:$B$5>=$F16,$C$2:$C$5),ROW($1:$4)),ROWS($16:16)-COUNTIF($B$2:$B$5,"<="&F16)))
Then in A9 filled down and across to B12 this non-array formula.
Formula:
=INDEX(A$2:A$5,MATCH($C9,$C$2:$C$5,0))
Copy that whole range and paste into cell A16. You may have to reformat the numbers as dates.
Bookmarks