简体   繁体   English

如何匹配来自两个不同工作簿的两列中的值

[英]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 假设

  1. The UPC/EAN column is to the left of the stock column (In WB1) “ UPC / EAN”列在“ stock”列的左侧(在WB1中)
  2. The UPC/EAN column only contains unique values UPC / EAN列仅包含唯一值

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 / EANInventory / 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.

相关问题 在两个不同的工作簿中添加列和查找值 - Add columns and lookup values in two different workbooks 链接来自两个不同工作簿的列 - Link columns from two different workbooks 如何比较两个不同的Excel工作簿中的列 - How to compare columns from two different excel workbooks 比较不同工作簿中的两列 - Compare two columns in different workbooks 需要帮助比较不同工作簿中两列的值 - Need help comparing values of two columns in different WorkBooks 比较来自2个不同工作簿的两列的更快方法 - Faster method to compare two columns from 2 different workbooks 如何比较Excel中的两列(来自不同工作表),如果前两列匹配,则复制相应列中的值? - How to compare two columns in Excel (from different sheets) and copy values from a corresponding column if the first two columns match? 需要比较两个不同工作簿中的测试用例,如果它们匹配,则将同一行其他列中的结果比较到新工作簿中 - Need to compare test cases from two different workbooks and if they match then compare the results in the other columns of same row into new workbook Excel:比较两个工作簿上的两列,如果匹配副本到新工作簿 - Excel: Compare two columns on two workbooks and if match copy to a new workbook 如何查找两个相邻单元格中的值是否与2个不同列中的两个相邻单元格值匹配 - How to find if values in two adjacent cells match to two adjacent cell values in 2 different columns
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM