Excel 将列表 2(当前)与列表 1(现有)进行比较以查找重复项目和新项目

发布于 2025-01-19 13:01:10 字数 279 浏览 0 评论 0原文

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 技术交流群。

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

发布评论

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

评论(2

浮萍、无处依 2025-01-26 13:01:10

我承认我的解决方案不起作用,但您可能会对总体思路有所帮助:

我从两个公式开始:

=IF(COUNTIF(A$1:A$6,B2)>0,B2,"")
=IF(COUNTIF(A$1:A$6,B2)=0,B2,"")

如您所见,我使用 COUNTIF() 来查看列中某个项目的出现次数B 出现在 A 列中,基于此我做了两件事:

- If the item appears at least one time, it is shown, else an empty string is shown.
- If the itema appears not at all, it is shown, else an empty string is shown.

这样,您会得到两列,其中包含您要查找的值。

然后我的想法是对它们进行“排序”,先获取第一个条目,然后是第二个条目,然后是第三个条目,...,使用 LARGE() 函数,但这似乎不起作用( LARGE() 似乎只适用于数字)。如果您能找到一种方法从字符串数组中获取最大的,然后是第二大的……,您可能会找到解决方案。

I admit that my solution is not working, but you might be helped with the general idea:

I started with two formulas:

=IF(COUNTIF(A$1:A$6,B2)>0,B2,"")
=IF(COUNTIF(A$1:A$6,B2)=0,B2,"")

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:

- If the item appears at least one time, it is shown, else an empty string is shown.
- If the itema appears not at all, it is shown, else an empty string is shown.

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.

若水般的淡然安静女子 2025-01-26 13:01:10

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))),"") in C2 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))),"") in D2 copied down.

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