excel行列突出显示
With Excel's conditional formatting, you can highlight cells based on specific rules. There are some built-in rules available, and you can use formulas to create your own formatting rules.
使用Excel的条件格式 ,您可以根据特定规则突出显示单元格。 有一些内置规则可用,您可以使用公式来创建自己的格式设置规则 。
突出显示重复项 (Highlight Duplicates)
In this example, we want highlight duplicate records in a table. There is a built-in rule for highlighting duplicate values in a single column, but nothing that will check an entire row.
在此示例中,我们要突出显示表中的重复记录。 有一个内置规则可以突出显示单个列中的重复值,但是没有规则可以检查整个行。
So, we’ll create our own rule, and it will require a new column on the worksheet, before we add the conditional formatting.
因此,我们将创建自己的规则,在添加条件格式之前,它将需要工作表上的新列。
连接数据 (Concatenate the Data)
In the sample data, there are two identical rows, and these should be highlighted after we apply our conditional formatting.
在示例数据中,有两个相同的行,并且在应用条件格式后应突出显示这些行。
The first step is to use the CONCATENATE function to combine all the data into one cell in each row. Add a new heading in cell G1 – AllData – and in cell G2, enter this formula, to combine the data from all the cells in that row.
第一步是使用CONCATENATE函数将所有数据组合到每一行的一个单元格中。 在单元格G1 – AllData中添加一个新标题,并在单元格G2中输入此公式,以合并该行中所有单元格的数据。
=CONCATENATE(A2,B2,C2,D2,E2,F2)
= CONCATENATE(A2,B2,C2,D2,E2,F2)
Next, copy the formula down to the last row of data.
接下来,将公式复制到数据的最后一行。
应用条件格式 (Apply the Conditional Formatting)
Then, a conditional formatting rule is set, to color the rows that are duplicate records. We’ll use the COUNTIF function to check for duplicates in the AllData column.
然后,设置条件格式设置规则,为重复记录的行着色。 我们将使用COUNTIF函数检查AllData列中的重复项。
=COUNTIF($G$2:$G$8,$G2)>1
= COUNTIF($ G $ 2:$ G $ 8,$ G2)> 1
If there is more than one instance of a data combination, that indicates a duplicate row, and the cells in columns A:F will be coloured. The two rows with duplicate records are highlighted, so our conditional formatting formula worked!
如果一个数据组合的实例不止一个,则表明存在重复行,并且A:F列中的单元格将带有颜色。 具有重复记录的两行将突出显示,因此我们的条件格式公式起作用了!
下载样本文件 (Download the Sample File)
For detailed instructions, and to download the sample file, please visit my Contextures website: Highlight Duplicate Records in a List
有关详细说明和下载示例文件,请访问我的Contextures网站: 在列表中突出显示重复记录。
观看视频 (Watch the Video)
To see the steps for setting up the conditional formatting, watch this short video.
要查看设置条件格式的步骤,请观看此简短视频。
翻译自: https://contexturesblog.com/archives/2013/04/11/highlight-duplicate-records-in-an-excel-list/
excel行列突出显示