For cell F6, I found this formula to work:
=SUM(COUNTIFS(C2:C12,FILTER(C2:C12,B2:B12=2,""),A2:A12,"Diagnosis"))
Using the named ranges described above:
=SUM(COUNTIFS(Names,FILTER(Names,Value=2,""),Criteria,"Diagnosis"))