If statement

W

WT

Probably just late in the evening but am trying to capture an adjacent column
to a unique identifier from another worksheet and populate in the original
worksheet. The first worksheet may have duplicate entries but all rows would
need to bring back information e.g.

Worksheet 1 :
Column A
12345
12345
15432
14325
Worksheet 2 :
Column A Column B
12345 Bananas
12432 Apples
15325 Pears

Worksheet 1 after add function :
12345 Bananas
12345 Bananas
12432 Apples
15325 Pears

Anything simple would be good although in the future likely to be pulling
back several cells of information adjacent and unique to the identifier.

Thanks
 
P

Pete_UK

You could try VLOOKUP - as you have not given any ranges for your
data, I've used full-column references:

=VLOOKUP(A1,Sheet2!A:B,2,0)

and copy down as required.

If you are likely to have more columns in future, you could try this:

=VLOOKUP($A1,Sheet2!$A:$F,COLUMN(B1),0)

and then you could copy this across (to column F maximum) - the COLUMN
parameter will adjust automatically to give you 2, 3, 4 etc.

Hope this helps.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top