简体   繁体   English

在vlookup表数组中使用OR

[英]Use OR in vlookup Table Array

Is it possible to write a vlookup to point to one worksheet or another? 是否可以编写vlookup指向一个或另一个工作表?

I have a master spreadsheet that points to a weekly spreadsheet via vlookup. 我有一个主电子表格,该电子表格通过vlookup指向每周电子表格。 Sometimes the sheet name will be called "SKU" and other times "Sales by sku". 有时,工作表名称将被称为“ SKU”,有时则被称为“ Sales by sku”。

The sheet name is the only part that changes. 工作表名称是唯一更改的部分。 The cell ranges i point to will be the same for both circumstances. 在两种情况下,我指向的单元格范围将相同。

Can i write a vlookup to point to one sheet if not point to the other? 如果不指向另一张纸,我可以写一个vlookup指向一张纸吗?

My current vlookup: 我当前的vlookup:

=VLOOKUP(A2,'...OTC\\2016\\Reports Sent\\[Current BSL, Branch Stock, Whouse Stock, On Order.xls]SKU'!$D$1:$G$65536,4,FALSE)

I want something like: 我想要类似的东西:

[Current BSL, Branch Stock, Whouse Stock, On Order.xls]SKU OR Sales by sku'!$D$1:$G$65536,4,FALSE) [当前BSL,分支股票,Whouse股票,On Order.xls]按SKU进行SKU 销售!$ D $ 1:$ G $ 65536,4,FALSE)

Thanks 谢谢

IFERROR sould be enough in this case: 在这种情况下, IFERROR就足够了:

=IFERROR(VLOOKUP(A2,'...OTC\2016\Reports Sent\[Current BSL, Branch Stock, Whouse Stock, On Order.xls]Sales by sku'!$D$1:$G$65536,4,FALSE),VLOOKUP(A2,'...OTC\2016\Reports Sent\[Current BSL, Branch Stock, Whouse Stock, On Order.xls]SKU'!$D$1:$G$65536,4,FALSE))

EDIT 编辑

Merged with INDIRECT it should look like this: INDIRECT合并后,它应如下所示:

=IFERROR(VLOOKUP(A2,INDIRECT("'...OTC\2016\Reports Sent\[Current BSL, Branch Stock, Whouse Stock, On Order.xls]Sales by sku'!$D$1:$G$65536",1),4,FALSE),VLOOKUP(A2,INDIRECT("'...OTC\2016\Reports Sent\[Current BSL, Branch Stock, Whouse Stock, On Order.xls]SKU'!$D$1:$G$65536",1),4,FALSE))

使用Indirect(If(<logic here>,"'...OTC\\2016\\Reports Sent\\[Current BSL, Branch Stock, Whouse Stock, On Order.xls]SKU'!$D$1:$G$65536","second address")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM