I think my previous suggestion works, amended to include "D" and "N" but not "NICU", try this version in AA3 copied across and down

=SUM(COUNTIFS($C$2:$Z$2,AA$2,$C3:$Z3,{"C","D","P","N"}))