You could also use a simple Pivot Table, and filter the row labels as required, no complicated formulas needed
In XL 365 the FILTER function is also available
And your formula should be
Code:
=INDEX($A$3:$A$9,SMALL(IF($D$3<=$B$3:$B$9,ROW($A$3:$A$9)-ROW($A$3)+1,ROW(1:1)))
committed with Ctrl+Shift+Enter and pulled down