跳到主要内容

如何在Excel中从另一个列表中排除一个列表中的值?

假设您有两个数据列表,如左图所示。 现在,如果D列中存在名称,则需要删除或排除A列中的名称。如何实现? 如果两个列表位于两个不同的工作表中怎么办? 本文为您提供了两种方法。

使用公式从一个列表中排除另一个列表中的值

使用 Kutools for Excel 快速排除一个列表中的值与另一个列表中的值


使用公式从一个列表中排除另一个列表中的值

您可以应用以下公式来实现。 请执行以下操作。

1.选择一个与要删除的列表的第一个单元格相邻的空白单元格,然后输入公式 = COUNTIF($ D $ 2:$ D $ 6,A2) 进入编辑栏,然后按 输入 键。 看截图:

备注:在公式中,$ D $ 2:$ D $ 6是您将基于其删除值的列表,A2是要删除的列表的第一个单元格。 请根据需要更改它们。

2.继续选择结果单元格,向下拖动“填充手柄”直到其到达列表的最后一个单元格。 看截图:

3.继续选择结果列表,然后单击 时间 > 将A到Z排序.

然后您可以看到列表按如下所示的屏幕截图排序。

4.现在选择名称为结果1的整行,右键单击所选范围,然后单击 删除 删除它们。

现在,您已经在一个基于另一个列表的列表中排除了值。

备注:如果“ to-remove-list”位于另一个工作表(如Sheet2)的A6:A2范围内,请应用此公式 = IF(ISERROR(VLOOKUP(A2,Sheet2!$ A $ 2:$ A $ 6,1,FALSE)),“保持”,“删除”) 得到所有 保持删除 结果,请继续对Ato Z中的结果列表进行排序,然后手动删除包含当前工作表中“删除结果”的所有名称行。


使用 Kutools for Excel 快速排除一个列表中的值与另一个列表中的值

本节将推荐 选择相同和不同的单元格 实用程序 Kutools for Excel 解决这个问题。 请执行以下操作。

申请前 Kutools for Excel首先下载并安装.

1。 点击 库工具 > 选择 > 选择相同和不同的单元格。 看截图:

2.在 选择相同和不同的单元格 对话框,您需要:

  • 2.1选择要从中删除值的列表 在中查找值 框;
  • 2.2在列表中选择要删除的值的列表 根据 框;
  • 2.3选择 单细胞 在选项 基于 部分;
  • 2.4点击 OK 按钮。 看截图:

3.然后会弹出一个对话框,告诉您已选择了多少个单元格,请单击 OK 按钮。

4.现在,如果列D中存在值,则选择列A中的值。您可以按 删除 键以手动删除它们。

  如果您想免费试用(30天)此实用程序, 请点击下载,然后按照上述步骤进行操作。


使用 Kutools for Excel 快速排除一个列表中的值与另一个列表中的值


相关文章:

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
"foruma contains an error!"
Wondeful help...
This comment was minimized by the moderator on the site
the function is correct: maybe you have Excel in a different language than english. Change the function names in that way. :)
This comment was minimized by the moderator on the site
Thank you for this. It solved my problem of wanting to include only companies from a list
This comment was minimized by the moderator on the site
This formula subtracts list in column B from list in columnA:=FILTER(IFNA(MATCH(A2:A12,B2:B6,0),A2:A12),ISNUMBER(IFNA(MATCH(A2:A12,B2:B6,0),A2:A12))=FALSE)
This comment was minimized by the moderator on the site
But this one's simpler (Subtracts list in A2:A20 from list in D2:D6):=FILTER(A2:A20,ISERROR(MATCH(A2:A20,D2:D6,0))=TRUE)
This comment was minimized by the moderator on the site
Keith,

This formula was incredibly helpful (even more helpful than the actual blog post!) You're a life saver! This formula gets really powerful if you use it in dynamic arrays.
This comment was minimized by the moderator on the site
what if I have multiple columns?
This comment was minimized by the moderator on the site
Depends on the structure of your lists, but if you want to exclude several lists Y and Z from a single big list X, try something like this:
=FILTER(X3:X21,ISERROR(MATCH(X3:X21,Y3:Y6,0))*ISERROR(MATCH(X3:X21,Z3:Z5,0))=1)
this returns listX minus listY and listZ.
The "ISERROR(MATCH(X3:X21,Y3:Y6,0))" returns "TRUE" if an item in listX is missing from listY, likewise ISERROR(MATCH(X3:X21,Z3:Z5,0)) for listX and listZ.
A quirk of Excel is that "=TRUE*TRUE" will return "1". In fact, any number of TRUEs multiplied will return "1", but include a single FALSE and it will return "0".
So the FILTER will return only those items from the list where all the "ISERROR(MATCH....." formulae are TRUE.
For each additional list of items to exclude, add an extra *ISERROR(MATCH(listX,list_exclude,0)) before the "=1)"
This comment was minimized by the moderator on the site
You could try a filter of a filter:=FILTER(A2:A20,ISERROR(MATCH(A2:A20,FILTER(Array2,Include_criteria2)))=TRUE)
This comment was minimized by the moderator on the site
Apologies, that should read "Subtracts list in D2:D6 from list in A2:A20."
This comment was minimized by the moderator on the site
Apologies, that should read "Subtracts list in D2:D6 from list in A2:A20."
This comment was minimized by the moderator on the site
Apologies, that should read "Subtracts list in D2:D6 from list in A2:A20"
This comment was minimized by the moderator on the site
Good find. Thank you for this clever workaround. I thought was only possible via macros.
Possible to do the same using method 1, for a range consisting in two columns. i.e City, State in col D2:E20 while my A2:C1000 (B:C has city,state) has the set I need to get marked?
tried this did not work: =COUNTIF($D$2:$E$20,B2:C2). Unless you have another wonderful guide.
This comment was minimized by the moderator on the site
Как безграмотный человек писал эту статью? Тот, кто русский язык не учил, ни одной книги не прочел и не общался в социуме никогда? Уже с самого начала статьи обороты почти в каждом предложении такие, что на голову не натянешь. Зачем писать, если не умеешь писать?
This comment was minimized by the moderator on the site
I receive other values in the COUNTIF column like 2 but also higher numbers other than 0 and 1. What does that mean?
This comment was minimized by the moderator on the site
The values you get in the COUNTIF column are equal to the number of occurrences of the element in the right column. For example, if you have 5 displayed against a cell in the Name column, it means that this name was found in the To-remove-list not one, but five times.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations