just extend the logic
=COUNTIFS(A16:A9000,C2,N16:N9000,"<=0",M16:M9000,"<>solved")