lookup with multiple conditions and date range

Copper Contributor

Hi Team, please help me to get the data based on below requirement. 

Please help to me with relevant formula/looks. 

 

Discount% required in the Product Purchase Table 1 where Purchase date in table 1  falls between Season Start Date and Season Start Date in Table 2 with product match.

 

Product Purchase Table 1:
ProductProduct Purchase DateDiscount
A5-Jan-2110%
A1-Sep-22?
A7-Jul-21?
B21-Oct-21?
B12-Dec-21?
B15-Jun-22?

 

Discount Table 2   
ProductSeason Start DateSeason End DateDiscount
A1-Jan-2131-Mar-2110%
B1-Apr-2130-Jun-2120%
A1-Jul-2130-Sep-2130%
B1-Oct-2131-Dec-2140%

 

2 Replies

@gsabbella, Try using the following,
=IFERROR(FILTER(IF(C4=$C$14:$C$17,IF(D4>=$D$14:$D$17,IF(D4<$E$14:$E$17,$F$14:$F$17,""),""),""),IF(C4=$C$14:$C$17,IF(D4>=$D$14:$D$17,IF(D4<$E$14:$E$17,$F$14:$F$17,""),""),"")<>""),"")

Attached file for your reference. but you need to have the discount for the date in table 2, else you will get a blank cell.

 

@gsabbella 

=IFERROR(INDEX($D$12:$D$15,MATCH(1,(A3=$A$12:$A$15)*(B3>=$B$12:$B$15)*(B3<=$C$12:$C$15),0)),"")

If you don't have access to the FILTER function you can try INDEX and MATCH. Enter this formula with ctrl+shift+enter if you don't work with Office 365 or Excel 2021.

lookup discount.JPG