简体   繁体   English

我有2列的值。 试图查找列A中哪些不在列B中的值

[英]I have 2 columns with values. Trying to find which values in Column A that are not in Column B

Column A has 868 Rows and Column B has 452 rows. A列有868行,B列有452行。 How do I find all the values in Column A that are not in Column B? 如何在列A中找到所有不在列B中的值?

A quick way would be to use a helper column, let's say C. You can use Countif() to quickly check, then If() to make it logical: 一种快速的方法是使用一个辅助列,比方说C。您可以使用Countif()快速检查,然后使用If()使其具有逻辑性:

=If(Countif($B:$B,$A1)=0,"Not in Col. B","")

I wouldn't use the entire B column, for calculating/processing time, so adjust that range as necessary. 我不会将整个B列用于计算/处理时间,因此请根据需要调整该范围。 You could then sort by column C to bring all "Not in Col. B" to the top. 然后,您可以按列C进行排序,以将所有“不在列B中”置于顶部。

Edit: Ah, it's basically @pnut's suggestion, with a little more for ease of reading. 编辑:嗯,基本上是@pnut的建议,还有更多内容以便于阅读。 Also, probably would want to add If($A1<>"",...) just to make sure blank cells don't return "Not in Col. B" 另外,可能要添加If($A1<>"",...)只是为了确保空白单元格不会返回“不在Col B中”

If the values are distinct, then easier alternative with conditional formatting: 如果这些值是不同的,则可以使用条件格式更轻松地进行替换:

Select both ranges or columns > Home > Conditional Formatting > Highlight Cell Rules > Duplicate Values... > Unique > OK 选择两个范围或列>主页>条件格式>突出显示单元格规则>重复值...>唯一>确定

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

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