What results did you get? What did you expect?

When I put that formula in your sample file in row 3 it gave me the result 4 - it's counting all the AM columns which contain either "C", "P" or "NICU" which means it counts cells C3, I3, R3 and U3 (3 "C"s and 1 "P"), isn't that correct?