link excel columns

2019-08-24 15:25发布

I'm trying to link 2 lists similar to this:

List 1

 A        B 
0001   Company A
0002   Company B

List 2

 A        B
0002   email1
0001   email2

I want the output to be like this:

 A        B          C
0001   Company A   email2
0002   Company B   email1

What excel function should I use?

1条回答
放我归山
2楼-- · 2019-08-24 15:58

Given,

List 1

 A        B 
0001   Company A
0002   Company B

List 2

 D        E
0002   email1
0001   email2

In column C (cell C1) put:

=VLOOKUP(D1,D1:E2,2,FALSE)

and copy it vertically to as many cells as needed.

You should end up with

 A        B          C        D       E
0001   Company A   email2   0002   email1
0002   Company B   email1   0001   email2

To explain a bit about VLOOKUP:

VLOOKUP(lookup value or cell containing value, table with values to match against, column of table to return value from, find exact match (TRUE or FALSE))

查看更多
登录 后发表回答