Maybe, probably, but it seems like you're trying for some tortured hybrid of formulas and Autofilter.

Maybe a calculated field for a pivot table, dunno.