I believe I understand.
In cell C49 I have entered this array-entered formula and copied down to C56.
Formula:
=IFERROR(INDEX($C$9:$C$29,SMALL(IF(INDEX($D$9:$Q$29,,MATCH($D$47,$D$6:$Q$6,0))<>1,ROW($C$9:$C$29)-MIN(ROW($C$9:$C$29))+1),ROWS($1:1))),"")
If you are not familiar with array formulas they are not entered in the usual way. Array enter means the formula must be committed by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
The file is attached.
Does this do what you intend?
Bookmarks