Excel如何在3个相同值的多个中删除重复行
我想知道Excel是否有可能删除重复行,如果我具有3个相同的值,则该函数将删除2个重复并保持1,但是,如果相同的值大于3,则将保持2个重复。 等
如果它具有7个重复项,它将保留3个重复项
... rel =“ nofollow noreferrer”>
这就是在将重复项与删除之后的外观一样行
VBA,公式或其他Excel功能可以做到这一点吗?
I would like to know if there's a possibility for excel to remove duplicates rows if I have 3 same value, the function will remove 2 duplicate and keep 1, however if the same value is greater than 3, it will keep 2 duplicates. If it has 7 duplicates, it will keep 3 duplicates and so on... For example:
This is the original data that I want to remove:
This is how it should look like after the duplicates are removed along with the rows
Can VBA, formula, or other excel feature could do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将以下公式放入辅助柱中,例如将其放入单元格D2中并将其复制
= mod(countif($ a $ 2:$ a2,a2),3)= 1
= 1
现在显示为true所有其他行(您要删除)。现在,过滤助手列的值false并删除所有可见行。
如果这是一个重复的过程,则可以编写VBA例程来执行此操作。
Put the following formula into a helper column, eg put it into cell D2 and copy down
=MOD(COUNTIF($A$2:$A2,A2),3)=1
=1
will now show True for the 1st, 4th, 7th... row with the same value and False for all the other rows (that you want to delete).Now filter for the value FALSE of the helper column and delete all visible rows.
If this is a repeated process, you can write a VBA routine to do this.
您可以使用Excel公式。使用3个辅助列
countifs(a:a,a2)
countifs($ d $ 2 $ 2:d2,d2,d2)
iwterpal
iwter> iwter>如果((e2-quotient(e2-Quotient( e2,3)*3)= 1,1,“”)
You can use Excel formulas. Use 3 helper columns
COUNTIFS(A:A,A2)
COUNTIFS($D$2:D2,D2)
IF((E2-QUOTIENT(E2,3)*3)=1,1,"")
如果您具有Excel 365,则假设数据已在A列上排序,并从第2行
。 “ https://i.sstatic.net/akuej.png” alt =“在此处输入图像说明”>
或
如果您需要过滤到就地,只需将其中的任何一个内部用作滤镜列,例如
if you have Excel 365, assuming the data is sorted on column A and starts in row 2.
or
If you need to filter in-place, just use the inner part of either of these as the filter column, e.g.