我想对Excel中的数据做一些操作。作为背景,我有两个不同的表在不同的纸张与库存,一个是为材料所需的设备和另一个与库存的材料,他们都有相同的组成部分,但排序不同。我想将它们合并如下:表和所需的材料需要知道股票价值,以验证需要多少股票,在这种情况下对它们进行排序。
例如:
表1.表1
Part # Needed Stock
1234 5 I want here the value from table 2
5678 5 I want here the value from table 2
9876 6 I want here the value from table 2
5432 7 I want here the value from table 2表2.表2
Part # Stock
5432 2
9876 4
1234 1
5678 4重点不是手工逐个检查零件编号,以便将表2中的库存编号放在表1的库存列中。
如果你能帮我,我会非常感激的。
发布于 2016-10-03 15:03:26
您可以使用索引匹配函数来实现这一点。对于示例中的Stock列,可以使用以下函数作为stock列第2行中的函数
=INDEX(Sheet2!B$2:B$5,MATCH(Sheet1!A2,Sheet2!A$2:A$5,0))然后,您可以复制公式,并对所有需要的行进行复制。当您将公式复制到其他行时,$符号将保持返回值范围和查找值范围的稳定。查找值将对随后的每一行进行更改。
这里有一些注释,用来描述这里正在发生的事情。
=INDEX(Return_value_range, MATCH(Lookup_value, Lookup_value_range, Match_type))
Return_value_range – The range that holds the return values
Lookup_value – The value you want to find in the lookup value array
Lookup_value_range – The range containing lookup values
Match_type – Exact (0), Nearest Greater Than (-1), or Nearest Less Than (1)最后,这里有一个链接,它给出了使用索引匹配相对于以前非常常见的VLOOKUP函数http://eimagine.com/say-goodbye-to-vlookup-and-hello-to-index-match/的可以描述。
https://stackoverflow.com/questions/39834282
复制相似问题