=SUM(N(MMULT(N($B$2:$G$13=J2),ROW($1:$6)^0)*MMULT(N($B$2:$G$13=K2),ROW($1:$6)^0)>0))
With legacy Excel such as Excel 2013 you can apply this formula which has to be entered with ctrl+shift+enter as an arrayformula if you don't work with Excel for the web or Office365.