Excel 将列表 2(当前)与列表 1(现有)进行比较以查找重复项目和新项目
Existing Current Duplicates New
------------------------------------------
apple banana banana plum
orange plum grapes mango
banana grapes
strawberry mango
grapes
有什么建议可以根据“当前”列表获取“重复”和“新”吗?
Existing Current Duplicates New
------------------------------------------
apple banana banana plum
orange plum grapes mango
banana grapes
strawberry mango
grapes
Any suggestion to get the "duplicate" and "new" based on the "current" list?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我承认我的解决方案不起作用,但您可能会对总体思路有所帮助:
我从两个公式开始:
如您所见,我使用
COUNTIF()
来查看列中某个项目的出现次数B 出现在 A 列中,基于此我做了两件事:这样,您会得到两列,其中包含您要查找的值。
然后我的想法是对它们进行“排序”,先获取第一个条目,然后是第二个条目,然后是第三个条目,...,使用
LARGE()
函数,但这似乎不起作用(LARGE()
似乎只适用于数字)。如果您能找到一种方法从字符串数组中获取最大的,然后是第二大的……,您可能会找到解决方案。I admit that my solution is not working, but you might be helped with the general idea:
I started with two formulas:
As you see, I used
COUNTIF()
to see how many times an item from column B appears in column A, and based on that I did two things:Like that, you get two columns with the values you're looking for.
Then it was my idea to "sort" them, by taking the first entry, then the second, then the third, ..., using the
LARGE()
function, but that seems not to work (LARGE()
only seems to work on numbers). If you would find a way to get the largest, then the second largest, ... from an array of strings, you might find a solution.Office 365解决方案:
=过滤器(B2:B5,Countif(A2:A6,B2:B5))
= filter(b2:b5,countif(a2:a6,b2:b5)= 0)
旧的excel:
= ifError(index(b:b,骨架)(15,6,行($ b $ 2:$ b $ 5)/countif($ a $ a $ 2:$ a $ 6,$ 6,$ b $ 2:$ b $ 5),行( 1:1))),“”)
在c2
中被复制。= ifError(index(b:b,骨料(15,6,行)($ b $ 2:$ b $ 5)/(countif($ a $ 2:$ 2:$ a $ 6,$ 6,$ b $ 2:$ b $ 2:$ b $ 5)= 0 ),第(1:1))),“”)
在d2
中被复制。Office 365 solution:
=FILTER(B2:B5,COUNTIF(A2:A6,B2:B5))
=FILTER(B2:B5,COUNTIF(A2:A6,B2:B5)=0)
Older Excel:
=IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW($B$2:$B$5)/COUNTIF($A$2:$A$6,$B$2:$B$5),ROW(1:1))),"")
inC2
copied down.=IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW($B$2:$B$5)/(COUNTIF($A$2:$A$6,$B$2:$B$5)=0),ROW(1:1))),"")
inD2
copied down.