AA3: =COUNTIFS($C$2:$Z$2,AA$2,$C3:$Z3,"C")

copy across and down