2

My column structure is as follows:

Column A:
SKU
AD01,
AD01,
AD01,
AD01,
AD02,
AD02,
AD02,
AD02,
AD03,
AD03,
AD03,
...

Column B:
empty

Column C:
SKU
AD01,
AD02,
AD03,
...

Column D:
ID
1,
2,
3,
4,
5,
...

The idea is to match the SKU from Column A with the SKU from Column C and output the ID from Column D to Column B.

SKU's in Column C are unique. SKU's in Column A are not.

What is the best way to do something like this?

5

the formula in B2 will look like this: you can then let Excel populate the formula in B3, B4 etc by dragging.

=VLOOKUP(A2,C:D, 2, FALSE)

it means to look up A2's value in column C,D, once found, get the value in the 2nd column which is the value in column D.

  • For someone who's trying to pick key and value from columns that are not next to each other, you might have to change the third parameter above accordingly. eg: "2" for C:D --> but it would be changed to "3" if your keys column is C and value column is "E" instead of D compared to above answer. – Chathura Kulasinghe Jun 10 '15 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.