I am trying to count the number of times that any one of the following values occurs in a column: "1" "2" "2i" or "P"

I tried using =COUNTIF(BD2:BD45,"P")+COUNTIF(BD2:BD45,"2")+COUNTIF(BD2:BD45,"2!")+COUNTIF(BD2:BD45,"1"). However, if I apply a filter to one of my other columns, the result does not change to reflect the filtered out rows.

How can I make this work?

I am using Excel 2013.

Thanks.