使用 Excel 匹配结果作为列选择

发布于 2024-11-02 21:46:05 字数 661 浏览 6 评论 0原文

我有一个 MATCH 表达式,它返回有效的行号。

我现在需要将此结果与已知的列标识符结合起来以返回该单元格的结果。

因此,如果 A50 上的内容 = "apple",那么我就可以获得单元格 D50 的内容。

我查看了 INDIRECT 和 INDEX ,但我没有看到它有什么帮助。

答案:

=INDEX('SHEET1'!A:D,MATCH(SHEET2!A2,'SHEET1'!B:B,0),4)

我让 INDEX 开始工作。需要更多的阅读时间。

'SHEET1'!A:DINDEX 使用的范围。

MATCH(SHEET2!A2,'SHEET1'!B:B,0) 正在根据我的 MATCH 标准拉取该行。

4 是使用上面 MATCH 中的编号返回单元格内容的

希望这能帮助其他人了解如何使用 INDEX

I have a MATCH expression that returns the valid row number.

I now need to combine this result with a known Column identifier to return the results of that cell.

So, if something on A50 = "apple", then I can get the contents of cell D50.

I looked at INDIRECT and INDEX, but I'm not seeing how it can help.

Answer:

=INDEX('SHEET1'!A:D,MATCH(SHEET2!A2,'SHEET1'!B:B,0),4)

I got INDEX to work. It took some more reading up on it.

'SHEET1'!A:D is the range for INDEX to work with.

MATCH(SHEET2!A2,'SHEET1'!B:B,0) is pulling the row based upon my MATCH criteria.

4 is the column to return the cell contents from using the row number from the MATCH above.

Hopefully this will help someone else understand how to use INDEX.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

≈。彩虹 2024-11-09 21:46:05

=INDEX('SHEET1'!A:D,MATCH(SHEET2!A2,'SHEET1'!B:B,0),4)

我让 INDEX 工作。又读了一些书。

'SHEET1'!A:D 是 INDEX 使用的范围。 MATCH(SHEET2!A2,'SHEET1'!B:B,0) 正在根据我的 MATCH 标准拉动该行。 4 是使用上面 MATCH 中的 ROW 编号返回单元格内容的 COLUMN。

然而,给出的其他选项也非常有帮助。

=INDEX('SHEET1'!A:D,MATCH(SHEET2!A2,'SHEET1'!B:B,0),4)

I got INDEX to work. Took some more reading up on it.

'SHEET1'!A:D is the range for INDEX to work with. MATCH(SHEET2!A2,'SHEET1'!B:B,0) is pulling the row based upon my MATCH criteria. 4 is the COLUMN to return the cell contents from using the ROW number from the MATCH above.

However, the other options given were very helpful as well.

尝试一下 VLOOKUP。例如,

=VLOOKUP("apple",$A$1:$D$100,4,false)

这是一个非常有用的功能。

Give VLOOKUP a try. For example,

=VLOOKUP("apple",$A$1:$D$100,4,false)

It's a very useful function.

森林散布 2024-11-09 21:46:05

间接允许您通过使用动态值指定其位置来引用工作表中的任意单元格。在您的情况下,您需要执行以下操作:

=INDIRECT("D"&MATCH(<your match here>))

这将返回您给出的示例中单元格 D50 的值。 Excel 文档称它返回对该单元格的“引用”,但实际上它会立即计算为单元格的值。

与 VLOOKUP 相比,此方法的主要优点是 INDIRECT 将引用任意单元格,而 VLOOKUP 需要已知的数据范围和匹配值。例如,如果您的 MATCH 条件引用了您要提取的数据中的另一张工作表,则最佳选择是 INDIRECT

INDIRECT allows you to refer to any arbitrary cell in the sheet by specifying its location using a dynamic value. In your case, you'll want to do something like this:

=INDIRECT("D"&MATCH(<your match here>))

That will return the value of the cell D50 in the example you've given. The Excel documentation says it returns a "reference" to that cell, but in reality it's immediately evaluated to the cell's value.

The main benefit of this approach over VLOOKUP is that INDIRECT will refer to any arbitrary cell, whereas VLOOKUP requires a known data range and a matching value. For example, if your MATCH criteria references another sheet from the data you want to pull, your best option is INDIRECT.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文