Excel - 根据另一个列表提取数据

发布于 2024-07-25 13:47:19 字数 182 浏览 6 评论 0原文

我有一个 Excel 工作表,其中包含两列(名称/ID),然后是另一个列表,该列表仅是上述较大列表中的名称的子集。 我想遍历子集列表,然后从较大的列表(名称/ID)中提取数据并将其放在其他地方...本质上仅在名称位于子集上时才从较大的列表中获取数据。

我尝试使用过滤器,但无法正常工作。 想法?

谢谢。

I have an Excel worksheet with two columns (name/ID) and then another list that is a subset of the names only from the larger aforementioned list. I want to go through the subset list and then pull the data from the larger list (name/ID) and put it somewhere else...essentially only grabbing the data from the larger list if the name is on the subset.

I tried using Filters, but couldn't get it work. Thoughts?

Thanks.

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

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

发布评论

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

评论(4

酷炫老祖宗 2024-08-01 13:47:19

新 Excel 版本

=IF(ISNA(VLOOKUP(A1,B,B,1,FALSE)),"",A1)

旧版 Excel 版本

=IF(ISNA(VLOOKUP(A1;B) :B;1;FALSE));"";A1)

即:“如果B列中存在A1的值,则在此显示,如果不存在,则留空。”

New Excel versions

=IF(ISNA(VLOOKUP(A1,B,B,1,FALSE)),"",A1)

Older Excel versions

=IF(ISNA(VLOOKUP(A1;B:B;1;FALSE));"";A1)

That is: "If the value of A1 exists in the B column, display it here. If it doesn't exist, leave it empty."

千秋岁 2024-08-01 13:47:19

我无法让第一种方法起作用,我知道这是一个老话题,但这就是我最终为解决方案做的事情:

=IF(ISNA(MATCH(A1,B:B,0)),"Not Matched", A1)

基本上,将 A1 与 B 列完全匹配(0 代表与某个值完全匹配)在 B 列)。 ISNA 测试 #N/A 响应,如果未找到匹配项,则返回匹配项。 最后,如果 ISNA 为 true,则将“Not Matched”写入所选单元格,否则写入匹配单元格的内容。

I couldn't get the first method to work, and I know this is an old topic, but this is what I ended up doing for a solution:

=IF(ISNA(MATCH(A1,B:B,0)),"Not Matched", A1)

Basically, MATCH A1 to Column B exactly (the 0 stands for match exactly to a value in Column B). ISNA tests for #N/A response which match will return if the no match is found. Finally, if ISNA is true, write "Not Matched" to the selected cell, otherwise write the contents of the matched cell.

于我来说 2024-08-01 13:47:19

您尝试过高级过滤吗? 使用您的短列表作为“标准”,使用长列表作为“列表范围”。 使用选项:“就地过滤”和“唯一值”。

您应该会看到仅出现在您的简短列表中的唯一值列表。

或者,如果您愿意,也可以将“唯一”列表粘贴到其他位置(在同一张纸上)。 选择“复制到另一个位置”选项,然后在“复制到”框中输入您想要唯一列表的单元格引用(例如 F1)。

注意:如果您选择两列作为“条件”和“列表范围”,这也适用于两列(名称/ID)。

Have you tried Advanced Filter? Using your short list as the 'Criteria' and long list as the 'List Range'. Use the options: 'Filter in Place' and 'Unique Values'.

You should be presented with the list of unique values that only appear in your short list.

Alternatively, you can paste your Unique list to another location (on the same sheet), if you prefer. Choose the option 'Copy to another Location' and in the 'Copy to' box enter the cell reference (say F1) where you want the Unique list.

Note: this will work with the two columns (name/ID) too, if you select the two columns as both 'Criteria' and 'List Range'.

花开半夏魅人心 2024-08-01 13:47:19

和其他人一样,我也一直在为此烦恼。

我使用了标准;

=countif(matchingList,C2)=0

其中matchingList 是我用作过滤器的列表。

看看这个

http://www.youtube.com/ watch?v=x47VFMhRLnM&list=PL63A7644FE57C97F4&index=30

我发现的技巧是,通常情况下,您会在与数据列标题匹配的条件中拥有列标题。 这对于公式标准不起作用。

我发现,如果我将列标题留空,则仅适用于高级过滤器中具有 countif 公式的条件。 如果我有列标题,即公式示例中 C2 列的列标题,则过滤器不会返回任何输出。

希望这可以帮助

I have been hasseling with that as other folks have.

I used the criteria;

=countif(matchingList,C2)=0

where matchingList is the list that i am using as a filter.

have a look at this

http://www.youtube.com/watch?v=x47VFMhRLnM&list=PL63A7644FE57C97F4&index=30

The trick i found is that normally you would have the column heading in the criteria matching the data column heading. this will not work for criteria that is a formula.

What I found was if I left the column heading blank for only the criteria that has the countif formula in the advanced filter works. If I have the column heading i.e. the column heading for column C2 in my formula example then the filter return no output.

Hope this helps

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