I have 2 tables here:
I want to fill up the Code column in Table 1 by referring to Table 2. The condition for the value is that the Start date must be in between the ProductionDate and ExpiryDate of Table 2, and the Type in Table 1 must match the Type in Table 2, else return NA. I have come up with the formula for cell D4
=IFS(AND(C4>=$H$4,C4<=$I$4,B4=$G$4),$F$4,AND(C4>=$H$5,C4<=$I$5,B4=$G$5),$F$5,AND(C4>=$H$6,C4<=$I$6,B4=$G$6),$F$6)
Is there a simpler way to write the formula?

