=IF(B$1=OFFSET(INDEX('Sheet1'!$A:$O,MATCH($A4,'Sheet1'!$A:$A,0),1),-1,14),INDEX('Sheet2'!$A$1:$I$1000,MATCH($A4,'Sheet2'!$A:$A,0),4),IF(B$1=OFFSET(INDEX('Sheet1'!$A:$O,MATCH($A4,'Sheet1'!$A:$A,0),1),-1,15),INDEX('Sheet2'!$A$1:$I$1000,MATCH($A4,'Sheet2'!$A:$A,0),4),IF(B$1=OFFSET(INDEX('Sheet1'!$A:$O,MATCH($A4,'Sheet1'!$A:$A,0),1),-1,16),INDEX('Sheet2'!$A$1:$I$1000,MATCH($A4,'Sheet2'!$A:$A,0),4),IF(B$1=OFFSET(INDEX('Sheet1'!$A:$O,MATCH($A4,'Sheet1'!$A:$A,0),1),-1,17),INDEX('Sheet2'!$A$1:$I$1000,MATCH($A4,'Sheet2'!$A:$A,0),4),IF(B$1=OFFSET(INDEX('Sheet1'!$A:$O,MATCH($A4,'Sheet1'!$A:$A,0),1),-1,18),INDEX('Sheet2'!$A$1:$I$1000,MATCH($A4,'Sheet2'!$A:$A,0),4),0)))))
Can this be simplified into a shorter formula?
Can this be simplified into a shorter formula?