检索Excel中列等于某事的单元格列表 [英] Retrieve List of Cells in Excel Where Column Equals Something

查看:117
本文介绍了检索Excel中列等于某事的单元格列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Excel中执行某些操作,而不使用VBA宏。我怀疑这是可能的,但到目前为止还有一些空白。基本上,对于表中的值,我想在列A中有条件地检索列B中的所有值,其中列B等于我提供的值。

I'm trying to do something in Excel without using VBA macros. I suspect it is possible, but have some up empty so far. Basically for values in a table, I'd like to retrieve a list of all values in Column A conditionally where Column B equals a value I provide.

例如我'如果列B等于零,那么就像一个函数,它实质上返回列A的单元格的范围/描述。

For example I'd like a function that essentially returns a range/description of cells for Column A if Column B is equal to zero.

Column A  Column B
   1          0
   2          0
   3          1
   4          0

将返回描述单元格a2,a3和a5(1,2,4)的范围。我更愿意使用公式来执行此操作,而不是手动使用数据透视表。我愿意使用数据透视表创建数据视图,如果该表可以通过函数引用给出适当的结果。我也可以以任何方式对列B排序,如果这样做更容易。

would return a range describing cells a2, a3, and a5 (1, 2, 4). I'd prefer to be able to do this using a formula, and not manually using pivot tables. I would be willing to create a view of the data using pivot tables if that table could then be referenced via a function to give me the appropriate results. I am also able to sort Column B in any way if it makes it easier to do this.

最终我需要从列A中提取出符合

Ultimately I need to pull out a random value from Column A that meet the criteria of Column B in case that matters in the final solution.

谢谢。

推荐答案

使用数组公式。

输入:

= INDEX($ A $ 1:$ A $ 4,体积(IF($ C $ 1 = $ B $ 1:$ B $ 4中,ROW($ B $ 1:$ B $ 4)),ROW(1:1)),1)

然后按Ctrl + Shift + Enter。拖动并填充下面的单元格直到 #NUM!显示。该公式假设您要查找的值位于 C1 中,没有标题(数据从第一行而不是第二行开始)。

then press Ctrl+Shift+Enter. Drag and fill the cells below until #NUM! shows up. This formula assumes the value you're looking for is in C1 and there are no headers (data starts in 1st row rather than 2nd).

这篇关于检索Excel中列等于某事的单元格列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆