ngwilliams
ngwilliams

Reputation: 269

Match name and copy row from sheet 1 to sheet 2 on corresponding column

I asked a very similar question to this one here, but I am trying to identify if a cell's numerical value is contained in a list of cells on a different sheet. If the cell from sheet A matches a cell in sheet B, mark a different column in B with a corresponding row in sheet A, otherwise leave it blank. An example is below:

Sheet A

Column A | Column B
-------------------
   1        John
   2        Sue
   4        Bob

I would like the corresponding Sheet B to populate Column B like this:

Sheet B

Column A | Column B
-------------------
   2         Sue
   3        
   4         Bob

=IF(ISNUMBER(MATCH(I2, 'SALT, WOD, Champion Members'!A:A, 0)), "Y", "N")

I have been using the above answer to populate a different column in the same workbook, and I'm thinking I can maybe use this formula, but instead of "Y" or "N", somehow preserve the row.

Upvotes: 5

Views: 33260

Answers (2)

Sam
Sam

Reputation: 7313

You need to use VLOOKUP as already mentioned. But you will need to use another function to check for existence of the value, else you will get #N/A against ID 3

I used COUNTIF

=IF(COUNTIF($A$2:$A$4,E2)=0,"",VLOOKUP(E2,$A$2:$B$4,2,FALSE))

VLOOKUP

Upvotes: 3

littleimp
littleimp

Reputation: 1169

Use the VLOOKUP function:

=VLOOKUP(A1;Sheet1!A:B;2;FALSE)

Where A1 is the value you want to look up, Sheet1!A:B is the original sheet with the data.

Upvotes: 1

Related Questions