简体   繁体   English

在 Excel 中使用间接索引和匹配

[英]Using Index and Match with Indirect in Excel

I need some help writing a formula.我需要一些帮助来编写公式。 Essentially what I want to do is be able to find a specific value from another workbook (Workbook2) by using the Index and Match functions.基本上我想要做的是能够通过使用索引和匹配函数从另一个工作簿(Workbook2)中找到一个特定的值。 However, the workbook being referenced can change (say, one day I need to use Workbook 3).但是,被引用的工作簿可能会改变(比如说,有一天我需要使用工作簿 3)。 I am using Indirect to call to that other workbook.我正在使用间接调用其他工作簿。 What I have right now is我现在拥有的是

 =INDEX(INDIRECT(SHEET1!$D$8),MATCH(A6,INDIRECT(SHEET1!$D$8),0),MATCH(N1,INDIRECT(SHEET1!$D$8),0))

where the SHEET1$D$8 cell holds the path to the other workbook (either Workbook2 or Workbook3) and A6 and N1 refer to the specific row and column that I want to match (for instance, A6 = "Type" and N1 = 713)其中SHEET1$D$8单元格包含指向另一个工作簿(Workbook2 或 Workbook3)的路径,A6 和 N1 指的是我要匹配的特定行和列(例如,A6 = "Type" 和 N1 = 713)

My issue though, is that after evaluating the function, it appears that when it goes to match, it can find the other workbook, but can't find the value (even though the specified row and column are definitely present).不过,我的问题是,在评估 function 之后,似乎在匹配时,它可以找到另一个工作簿,但找不到值(即使指定的行和列肯定存在)。 What I currently get is a #N/A value.我目前得到的是一个#N/A 值。

So, anyone know what might be going on?那么,有谁知道可能发生了什么? Or if there's a better way to approach this?或者如果有更好的方法来解决这个问题?

Thanks谢谢

thanks for the responses.感谢您的回复。 Turns out I just had to limit the cell range for matching the other workbook (not sure why, but it didn't seem to like it when I searched the entire worksheet).结果我只需要限制单元格范围以匹配另一个工作簿(不知道为什么,但当我搜索整个工作表时它似乎并不喜欢它)。

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

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