In F3:
=IF(OR(Sheet3!E3="Yellow",Sheet3!E3="Red"),LOOKUP(2,1/(Sheet3!C3=$C$28:$C$33)/(Sheet3!D3=$D$28:$D$33),$F$28:$F$33),"")