I am getting reference error which I am not understanding the logic behind. Anyone please help me with this. Thanks in Advance!!

SHEET 1:

```
SKU   Reference  Type   PP_1      PP_2
A       A         X     61.99    17.9975
A      A-A        Y     56.99    
A      A-S        Y     56.99    
B       B         X     68.99    19.7475
B      B-A        Y     68.99    

```

SHEET 2:

```
SKU   Reference  Type   PP_3      
A       A         X     17.9975 
A      A-A        Y     #REF     
A      A-S        Y     #REF     
B       B         X    19.7475   
B      B-A        Y    #REF

```

OUTPUT\_REQUIRED: 

```
SKU   Reference  Type   PP_3      
A       A         X    17.9975  
A      A-A        Y    56.99         
A      A-S        Y    56.99         
B       B         X    19.7475   
B      B-A        Y    68.99

```

FORMULA I TRIED:

```
=INDEX(Sheet1!D:E,MATCH(A5,Sheet1!A:A,0),MATCH(C5,{"X"," ","Y"},0)+AND(VLOOKUP(A5,Sheet1!A:C,3,FALSE)="X"))

```