With formulas alone, you would need a few helper columns with some COUNTIF arrays and INDEX(..MATCH( to pull it from the other side.

Or you could use an Advanced Filter macro. I went with the macro, as its considerably shorter and prettier.

adv filter macro for trobertfl.xlsm