Try this, F4, copy down & across

=IF(COUNTIF(INDEX($A$5:$C$10,0,MATCH(F$2,$A$3:$C$3,0)),$E4),F$3,"")