比较三列并添加第四列

时间:2014-11-24 09:55:09

标签: excel excel-formula lookup vlookup worksheet-function

我想比较C列和B列,并逐行复制D列中匹配的A列值。

A                    B                     C
192.132.14.1    IND-EDU-ROUTER-01   BOB-POL-ROUTER-01
192.132.27.1    IND-POL-ROUTER-01   DHL-TEA-ROUTER-01
192.241.173.1   CHN-EDU-ROUTER-01   IND-POL-ROUTER-01
192.31.27.1     CHN-POL-ROUTER-01   DHL-MKT-ROUTER-01
192.31.17.1     CHN-MGM-ROUTER-01   BOB-POL-ROUTER-01
192.61.27.1     BOB-POL-ROUTER-01   KEL-TEA-ROUTER-01
192.141.14.1    ASK-MGM-ROUTER-01   CHN-MGM-ROUTER-01
192.36.15.1     KEL-EDU-ROUTER-01   DHL-TEA-ROUTER-02
192.36.11.1     KEL-TEA-ROUTER-01   KEL-TEA-ROUTER-01
192.36.14.1     KEL-TRD-ROUTER-01   IND-EDU-ROUTER-01
192.71.16.1     DHL-MKT-ROUTER-01   IND-POL-ROUTER-01
192.71.14.1     DHL-TEA-ROUTER-01   CHN-EDU-ROUTER-01
192.71.15.1     DHL-TEA-ROUTER-02   CHN-POL-ROUTER-01

我的结果应如下所示:

A                      B                 C                  D
192.132.14.1    IND-EDU-ROUTER-01   BOB-POL-ROUTER-01   192.61.27.1
192.132.27.1    IND-POL-ROUTER-01   DHL-TEA-ROUTER-01   192.71.14.1
192.241.173.1   CHN-EDU-ROUTER-01   IND-POL-ROUTER-01   192.132.27.1
192.31.27.1     CHN-POL-ROUTER-01   DHL-MKT-ROUTER-01   192.71.16.1
192.31.17.1     CHN-MGM-ROUTER-01   BOB-POL-ROUTER-01   192.61.27.1
192.61.27.1     BOB-POL-ROUTER-01   KEL-TEA-ROUTER-01   192.36.11.1
192.141.14.1    ASK-MGM-ROUTER-01   CHN-MGM-ROUTER-01   192.31.17.1
192.36.15.1     KEL-EDU-ROUTER-01   DHL-TEA-ROUTER-02   192.71.15.1
192.36.11.1     KEL-TEA-ROUTER-01   KEL-TEA-ROUTER-01   192.36.11.1
192.36.14.1     KEL-TRD-ROUTER-01   IND-EDU-ROUTER-01   192.132.14.1
192.71.16.1     DHL-MKT-ROUTER-01   IND-POL-ROUTER-01   192.132.27.1
192.71.14.1     DHL-TEA-ROUTER-01   CHN-EDU-ROUTER-01   192.241.173.1
192.71.15.1     DHL-TEA-ROUTER-02   CHN-POL-ROUTER-01   192.31.27.1

我怎样才能做到这一点?

2 个答案:

答案 0 :(得分:1)

在B列和C列之间插入A列副本后使用Vlookup。

答案 1 :(得分:1)

请尝试:

=INDEX(A:A,MATCH(C2,B:B,0))  

复制到西装。

实际上,MATCH会找到在ColumnB中找到C2的内容多远,然后从ColumnA获取该行的相应单元格值。结果是重复的条目可能无法产生预期的结果。