[英]How to match up values in two columns from two different workbooks
We have two different excel workbooks (WB1 and WB2) that have similar columns. 我们有两个不同的Excel工作簿(WB1和WB2),它们具有相似的列。 One column labelled "UPC/EAN" and another column labelled "Inventory/Stock". 一栏标为“ UPC / EAN”,另一栏标为“库存/库存”。 What we are trying to do is match up the values in the "Inventory/Stock" column for a UPC in the "UPC/EAN" column on the same row on WB1 with the corresponding value in the "UPC/EAN" column in WB2 and have the value from WB1's "Inventory/Stock" column for that UPC entered in to the "Inventory/Stock" column of WB2. 我们想要做的是将WB1上同一行的“ UPC / EAN”列中的UPC的“库存/库存”列中的值与WB2中“ UPC / EAN”列中的对应值进行匹配并具有该UPC从WB1的“库存/库存”列中输入的值到WB2的“库存/库存”列中。 For example, if UPC "123456789" in the "UPC/EAN" column of WB1 has the value of "2" in the same row of column "Inventory"/"Stock" on WB1, that "2" would be placed in the "Inventory"/"Stock" column of WB2 on the same row as UPC "12345679" in column "UPC/EAN". 例如,如果WB1的“ UPC / EAN”列中的UPC“ 123456789”在WB1的“库存” /“股票”列的同一行中的值为“ 2”,则该“ 2”将被放置在WB2的“库存” /“库存”列与“ UPC / EAN”列中的UPC“ 12345679”位于同一行。 Is there a way to do this? 有没有办法做到这一点?
Please use the vlookup function. 请使用vlookup函数。 It is meant to do exactly what you are looking for. 它旨在完全满足您的需求。 If you run into an issue - simply look-up the help on vlookup function. 如果遇到问题-只需查找有关vlookup函数的帮助。
Assuming 假设
Then the VLookUp function will work, see link https://support.office.com/en-GB/article/VLOOKUP-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1 然后VLookUp函数将起作用,请参阅链接https://support.office.com/zh-CN/article/VLOOKUP-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1
but basically... 但基本上...
Take the name of the workbook (eg WB1 ) 取工作簿的名称(例如WB1 )
The name of the table in WB1 (eg Table1 ) WB1中的表的名称(例如Table1 )
The Names of the columns from WB1 (eg UPC/EAN and Inventory/Stock ) WB1中各列的名称(例如, UPC / EAN和Inventory / Stock )
The name of the UPC column in WB2 (eg UPC/EAN2 - it doesnt matter if its the same column name as in the 1st table, im just changing it for clarity) WB2中UPC列的名称(例如UPC / EAN2-它与第一张表中的列名称相同并不重要,为清楚起见,只需对其进行更改)
Count how many rows to the right the stock column is from the UPC column and then add 1. eg if the stock column is the first column to the right of the UPC column (ie, next to it) then count 2 计算UPC列中库存列右边的行数,然后加1。例如,如果库存列是UPC列右边(即,它旁边)的第一列,则计数2
Finally, in the stock column in WB2, type the following: 最后,在WB2的“库存”栏中,键入以下内容:
=VLOOKUP([@ UPC/EAN2 ], WB1 ! Table1 [[ UPC/EAN ]:[ Inventory/Stock ]], 2 ,FALSE) = VLOOKUP([@ UPC / EAN2],WB1 表1 [[UPC / EAN]:[ 库存/股票 ]]!,2,FALSE)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.