简体   繁体   English

如何只识别(而不是删除)Excel列中的重复项?

[英]How to just identify (and not remove) duplicates in excel column?

I have an excel sheet containing hundreds of rows. 我有一个包含数百行的Excel工作表。

A particular column might have values repeated across multiple rows in the same column. 特定列的值可能在同一列的多个行中重复。

I need to identify such values in that column. 我需要在该列中标识此类值。 How do I do that? 我怎么做?

VLOOKUP would be handy if I need to check value from 1 column exists in another column; 如果我需要检查另一列中是否存在1列中的值, VLOOKUP将很方便; but guess it would be very cumbersome to find duplicates in the same column. 但猜测在同一列中查找重复项将非常麻烦。

条件格式->高亮显示单元格规则->重复值

As M. Sgarbossa Mentioned, You can get the Duplicate Values by highlighting it. 正如M. Sgarbossa提到的那样,您可以通过突出显示重复值。 Otherwise You can use Match function to highlight the first value which will repeat later in the column. 否则,您可以使用“匹配”功能突出显示第一个值,该值稍后将在列中重复。 Use following function as given in image below: 使用下图所示的以下功能:

=IF(ISNUMBER(MATCH( Match_Value , Next_Cell:Last_Cell(Locked) ,0)),"Repeating","") = IF(ISNUMBER(MATCH( Match_ValueNext_Cell:Last_Cell(Locked) ,0)),“重复”,“”)

在此处输入图片说明

If you use vlookup you must pay attention that the range formula in the control column excludes the value itself ie: Let's say you have are looking for dups in column A from row 1 to 120, then in B1 you would write: 如果使用vlookup ,则必须注意控制列中的范围公式将值本身排除在外,即:假设您正在A列中寻找从第1行到第120行的重复值,那么在B1中您应该编写:

VLOOKUP(A1,A2:A$120,1,FALSE)

in B2: 在B2中:

VLOOKUP(A2,A3:A$120,1,FALSE)

With Conditional Formatting you have 2 ways: 使用条件格式,您有两种方法:

1) With the provided function Home->Conditional Formatting->Highligth Rules->Duplicate Values (which will color every duplicated values regardless of how many time they occur) 1)使用提供的功能Home-> Conditional Formatting-> Highligth Rules-> Duplicate Values(它将为每个重复值上色,而不管它们出现了多少次)

2) By creating a custom Highlight Rule (Home->Cond. Form->Highligh..->Other Rules->Use formula to determine...) and adding as a formula: 2)通过创建自定义突出显示规则(主页->条件表单->高亮..->其他规则->使用公式来确定...)并添加为公式:

=COUNTIF(A1:A120,A1:A120)>1

Where A1:A120 is the range of your search and >1 is the number of occurrence you look for. 其中A1:A120是您的搜索范围,> 1是您要查找的出现次数。 In that case only the duplicates are highlighted but not the 'original' (So if you have 2 times the value 'foobar' it will be highlighted only once). 在那种情况下, 仅重复项被突出显示,而“原始”则不突出显示 (因此,如果您拥有值'foobar'的2倍,它将仅突出显示一次)。

This method will allow you to give different colors to different occurrences (say: 2 times yellow, 3 times red...) 此方法将使您可以为不同的情况赋予不同的颜色(例如:2倍黄色,3倍红色...)

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

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