I have two worksheets that need comparing, sheet1 has an ID code in column A , in sheet2 there are multiple duplicates of this ID number. So I need a formula to also check if the matched row data in sheet2 , also has a matched value in matched row of Sheet2.column D , with the row the formula is checking in sheet1 column G and then if matched row of Sheet2.column I , with the row the formula is checking in sheet1 column Z . If all values are added then I need to Add the value of Sheet2.Column B to where the formula is.
The formula I tried to write would be something like this , but I just can work out how to do multiple match checks
=INDEX('Sheet1'!$B:$B,MATCH(@'Sheet1'!$A:$A,'Sheet2'!$A:$A,0),1) and MATCH(@'Sheet1'!$G:$G,'Sheet2'!$D:$D,0),1) and MATCH(@'Sheet1'!$Z:$Z,'Sheet2'!$I:$I,0),1)