My suggestion.Also Array formula.

=IFERROR(INDEX(Sheet1!$B$2:$B$100,SMALL(IF(Sheet1!$A$2:$A$100=1,ROW(Sheet1!$B$2:$B$100)-1),ROW(Sheet1!A1))),"")