Similar to the other thread... with the help of helper columns, the first 3 formulas remain the same...
In A4:
=IFERROR(INDEX(Sheet1!$A$2:$A$6,SMALL(IF(INDEX(Sheet1!$B$2:$F$6,0,MATCH($A$1,Sheet1!$B$1:$F$1,0))=1,ROW(Sheet1!$A$2:$A$6)-ROW(Sheet1!$A$2)+1),ROWS($A$4:$A4))),"")
CSE confirmed and copied down
in B4:
=IF(A4="","",COUNTIF(INDEX(Sheet1!$B$2:$F$6,0,MATCH(A4,Sheet1!$B$1:$F$1,0)),1)+B3)
copied down
in C4:
=IF(ROWS(A$4:A4)>MAX($B$4:$B$8),"",INDEX($A$4:$A$8,MIN(IF(ROWS(A$4:A4)<=$B$4:$B$8,ROW($B$4:$B$8)-ROW($B$4)+1))))
CSE confirmed and copied down
D4 changes to:
=IFERROR(INDEX(Sheet1!$A$2:$A$6,SMALL(IF(INDEX(Sheet1!$B$2:$F$6,MATCH(C4,Sheet1!$B$1:$F$1,0),0)=1,COLUMN(Sheet1!$B$2:$F$6)-COLUMN(Sheet1!$B$2)+1),COUNTIF(C$4:C4,C4))),"")
CSE confirmed and copied down
Bookmarks