跳到主要内容

如何在Excel中查找并突出显示范围内的重复行?

有时,工作表的数据范围中可能有一些重复的记录,现在您想要查找或突出显示该范围中的重复的行,如下面的屏幕快照所示。 当然,您可以通过检查行来一个接一个地找到它们。 但是,如果有数百行,这不是一个好选择。 在这里,我将讨论一些有用的方法来帮助您处理此任务。

 

使用公式在多列中查找重复行

使用条件格式突出显示多列中的重复行

使用方便的功能选择或突出显示跨多列的重复行


使用公式在多列中查找重复行

下面的公式可以帮助您找到重复的记录,请按照以下步骤操作:

1. 在相邻的空白单元格中,本例中的单元格 D2,请输入以下公式:

=IF(COUNTIFS($A$2:$A$12,$A2,$B$2:$B$12,$B2,$C$2:$C$12,$C2)>1, "Duplicate row", "")

2. 然后将填充手柄向下拖动到单元格以应用此公式,现在,您可以看到,如果在此使用范围内有相同的行,它将显示 重复行,请参见屏幕截图:

  • 笔记:
  • 1.在公式中 $ A $ 2:$ A $ 12, $ B $ 2:$ B $ 12, $ C $ 2:$ C $ 12 指示要从中查找重复项的范围列。 您可以根据需要更改它们。 和 A2, B2, C2 指出需要应用此公式的数据每一列中的第一个单元格,您也可以更改它们。
  • 2. 上述公式基于 3 列数据,如果您的数据范围中有 4 列或更多列需要从第一行中找到重复值,您只需添加列引用,如下公式所示: =IF(COUNTIFS($A$2:$A$12,$A2,$B$2:$B$12,$B2,$C$2:$C$12,$C2,$D$2:$D$12,$D2)>1, "Duplicate row", "").

Tips:如果要查找没有第一次出现的重复行,请应用以下公式:

=IF(COUNTIFS($A$2:$A2,$A2,$B$2:$B2,$B2,$C$2:$C2,$C2) >1, "Duplicate row", "")


使用条件格式突出显示多列中的重复行

如果您无法正确应用公式,请不要担心, 条件格式 实用程序还可以帮助您突出显示重复的行。 执行以下步骤:

1。 第一步,您应该使用 CONCATENATE 函数将所有数据合并到每一行的一个单元格中。 在单元格 D2 中键入以下公式,然后将公式向下复制,直到最后一行数据查看屏幕截图:

=CONCATENATE(A2,B2,C2)

2. 然后,选择要查找重复行(包括 D 列中的公式)的范围,然后转到 主页 选项卡,然后单击 条件格式 > 新规则,请参见屏幕截图:

3。 在 新格式规则 对话框,请执行以下操作:

  • 点击 使用公式来确定要格式化的单元格 来自 选择规则类型 列表框;
  • 然后输入这个公式 = COUNTIF($ D $ 2:$ D $ 12,$ D2)> 1 (突出显示第一次出现的重复行) 要么 =COUNTIF($D$2:$D2,$D2)>1 (突出显示没有第一次出现的重复行) 进入 格式化此公式为真的值 文本框;
  • 最后点击 格式 按钮。

备注:在以上公式中, $ D $ 2:$ D $ 12 是您已合并其他列值的列D。

4。 在弹出 单元格格式 对话框,单击 选项卡,然后选择一种您需要突出显示重复项的颜色。

5。 点击 OK > OK 关闭对话框,并用您一次选择的颜色突出显示重复的行,请参见屏幕截图:

用第一行突出显示重复行 突出显示没有第一行的重复行

使用方便的功能选择或突出显示跨多列的重复行

上面的方法对您来说有些麻烦,因此,在这里,我可以向您介绍一个简单方便的工具-Kutools for Excel,其 选择重复的和唯一的单元格 实用程序,您可以根据需要快速选择重复的行或唯一的行。

请注意:申请这个 选择重复的和唯一的单元格,首先,您应该下载 Kutools for Excel,然后快速轻松地应用该功能。

安装后 Kutools for Excel,请这样做:

1。 点击 库工具 > 选择 > 选择重复和唯一单元格,请参见屏幕截图:

2。 在 选择重复的和唯一的单元格 对话框,请执行以下操作:

  • 点击 按键1  按钮选择您要使用的范围;
  • 然后,选择 每一行 来自 基于 部分;
  • 然后,检查 重复项(第一个除外) or 全部重复(包括第一个) 选项下 您需要的部分;
  • 最后,您可以为下面的重复行指定背景颜色或字体颜色 处理结果.

3。 然后点击 OK,并选择以下行的重复行:

选择包括第一行在内的重复行 选择不包括第一行的重复行
  • 笔记:
  • 1.如果您检查 选择整行 选项,将选择整个重复或唯一行。
  • 2.如果选中区分大小写选项,则将比较文本是否区分大小写。

 下载并免费试用 Kutools for Excel 现在!


更多相关文章:

  • 合并重复的行并求和Excel中的值
  • 在Excel中,当您具有一系列包含某些重复项的数据时,您可能总是会遇到此问题,现在您想要合并重复数据并在另一列中求和相应的值,如下面的屏幕快照所示。 您如何解决这个问题?
  • 在Excel中以不同的颜色突出显示重复的值
  • 在Excel中,通过使用条件格式设置,我们可以轻松地用一种颜色突出显示一列中的重复值,但是有时,我们需要突出显示不同颜色的重复值,以便快速,轻松地识别重复项,如下面的屏幕快照所示。 您如何在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
Fórmulas lixo, nenhuma funciona!
This comment was minimized by the moderator on the site
Hello Carlos,
So sorry to hear that. But I did try all of the formulas in the article and they all works fine. Please see the screenshots I upload. And I would love to help you on this matter if only you could provide the details of the errors. Thanks.Sincerely,Mandy
This comment was minimized by the moderator on the site
The formula "Sumproduct" does not work! The values ​​keep appearing non-duplicate, and since there are duplicate values, you must have got something wrong with this formula. Because I did the same and checked several times to find the error, but I was unsuccessful
This comment was minimized by the moderator on the site
Hello, Elienay,
The above Sumproduct formula works well in my worksheet, could you give your problem as an image to insert here?
Thank you!
This comment was minimized by the moderator on the site
I had to invent another formula to check for duplicate values, in fact I created two formulas! But with this "sumproduct" I couldn't fix it. However I already solved my problem, thanks! The formula I created looked like this: =IF(CONTIF($G$53:$G$55;G53)>1;"DUPLI";"NO")
This comment was minimized by the moderator on the site
at the time of data entry can i stop duplicate entries in two columns example :- Table A Table B A 1 B 2 at the time data entry once A & 1 is coming than i don't enter this entry, can any formula & idea for this
This comment was minimized by the moderator on the site
Can i find duplicate entries in two columns at time of data entry, that can i prevent duplicate entries in two columns example, Table A Table B A 1 B 2 at time of data entry next A and 1 i don't enter this entry, plz give any idea
This comment was minimized by the moderator on the site
Hi, suppose i have data of 15 letters (alphanumeric), and i want it to be split in different columns. ex - ASDFGH11WE31005 this is the 15 letters code, i want it to be spilt in different columns like - AS DF GH 11 WE 3 1005 pls suggest any shortcut or any formula to split it
This comment was minimized by the moderator on the site
Good day, I am dealing with a similar problem but one that goes beyond just checking for duplicates and I am hoping you could shed some light in as to how to tackle it. To illustrate I will build up onto the problem you have already illustrated above and adding some more complexities to it. Suppose after checking for and finding duplicates (ie., product, order or quantity and price), you now want to select a shop from which you can now buy your products from (I assume the duplicates tells you what products in what amount you can buy at what prices, and there is that repeat of products, orders and prices). The Shop Name given is for the shop that actually has stock of items required. A B C D E F PRODUCT ORDER PRICE SHOP NAME Distance to Shop (miles) Shop chosen to buy from QQQQ 50 30 Shop A 15 ? PPPP 60 40 Shop A 15 ? XXXX 45 28 Shop B 30 ? QQQQ 50 30 Shop A 15 ? VVVV 65 42 Shop A 15 ? BBBB 48 21 Shop A 15 ? XXXX 45 28 Shop B 30 ? QQQQ 50 30 Shop B 30 ? MMMM 80 35 Shop B 30 ? Suppose you now know you can buy a product at the given quantities (order) and at the given prices, at either Shop A or Shop B or Shop B but now you want to decide on the shop to buy from. One of the factors used in the criteria for shop selection could be how far the shop is from your own location. Obviously for product XXXX the only shop to buy from, where the product is available is Shop B therefore the value to return under column E would always be Shop B. For product QQQQ, you would have the option of buying from either Shop A or Shop B. You now want Excel to have you choose a shop to buy from. You want to select the nearest shop. How would you go about using a formula to solve this one? Regards, Moses
This comment was minimized by the moderator on the site
Suppose you have now ascertained that there are duplicates and the next thing is you want to check is if these duplicates (products, orders, and prices) can be obtained are from different shops. This is tantamount to introducing another column listingshops which actaully sell these products and you want to be able to select a shop to buy from based on another criteria not listed here (knowledge of shop location,distance to the shop, etc) Eg for Product QQQ, you can get same order at same price at both Shop A and Shop B and you wanna return either Shop A or Shop B based on that criteria you know. How would you tell Excel to return as a value either either Shop A or Shop B? PRODUCT ORDER PRICE SHOP NAME QQQQ 50 30 Shop A PPPP 60 40 Shop A XXXX 45 28 Shop B QQQQ 50 30 Shop A VVVV 65 42 Shop A BBBB 48 21 Shop A XXXX 45 28 Shop B QQQQ 50 30 Shop B MMMM 80 35 Shop B
This comment was minimized by the moderator on the site
This is very very very great INFO !! i was so confused to find this kind of formula in excel sheet but today i am so happy may god give you lots of happiness and success, Great Work buddy you're a Champ !!
This comment was minimized by the moderator on the site
Great Great Great Really best ideas I've ever seen
This comment was minimized by the moderator on the site
Yes!!! NASEER you can find duplicates... :)
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations