1

In excel workbook I am trying to copy data from sheet1 to sheet2 with a condition, IF((Sheet1!B2:B80=Sheet2!A2:A80),Sheet2!D2) i am not getting the result.please help me solve this.

I am trying to copy from sheet1 to sheet2 with a condition if the the value in sheet 1,column B is equal to the value in sheet2 column A the value in column D of sheet 2 should be copied to column G of sheet1

Deduplicator
  • 44,692
  • 7
  • 66
  • 118

4 Answers4

1

Try do debug it step by step. What happens, if you change your formula in:

=IF((Sheet1!B2:B3=Sheet2!A2:A3),Sheet2!D2)

?

Or

=IF((Sheet1!B2:B3=Sheet2!A2:A3),"the same values")

Maybe not all the values are really exactly the same in columns A and B. Or D2 doesn't contain what you expect.

splattne
  • 102,760
  • 52
  • 202
  • 249
1

Put the following formula in the first cell of column G

=IF((Sheet1!B1=Sheet2!A1), Sheet2!D1)

then copy this cell down as far as you need to. Excel will change all the cell references for you.

Patrick Cuff
  • 28,540
  • 12
  • 67
  • 94
0

this should do what you are after.

=IF(Sheet1!B1=Sheet2!A1,Sheet2!D1)

Blounty
  • 3,342
  • 22
  • 21
0

=IF(EXACT(Sheet1!B1,Sheet2!A1),Sheet2!D1)