[英]Excel - How to highlight entire row if a specific cell is different from the cell above?
I am trying to apply conditional formatting in excel in which each first occurrence in a column has a highlight on the entire row.我正在尝试在 excel 中应用条件格式,其中列中的每个第一次出现都在整行上突出显示。 The desired result is as follows:期望的结果如下:
A一种 | B乙 |
---|---|
2 2个 | |
2 2个 | |
8 8个 | Highlight this entire row突出显示这一整行 |
5 5个 | Highlight this entire row突出显示这一整行 |
5 5个 | |
7 7 | Highlight this entire row突出显示这一整行 |
I currently have the formula "A3<>A2", but that highlight the last occurrence instead of the first.我目前有公式“A3<>A2”,但它突出显示了最后一次出现而不是第一次出现。 I don't know how to apply the highlight to all cells on the same row.我不知道如何将突出显示应用于同一行上的所有单元格。
UPDATE: Apparently excel behaves differently for text and numeric values.更新:显然 excel 对于文本和数值的行为不同。 My data looks like this:我的数据如下所示:
A一种 | B乙 |
---|---|
Apple苹果 | |
Apple苹果 | |
Banana香蕉 | Highlight this entire row突出显示这一整行 |
Kiwi猕猴桃 | Highlight this entire row突出显示这一整行 |
Kiwi猕猴桃 | |
Apple苹果 | Highlight this entire row突出显示这一整行 |
2:10
(focus on 2 ) and eg you are applying the corrected ( $
) formula =$A3<>$A2
which does what is expected: it highlights the last occurrence in a group ie if the value of the next row ( 3 ) is different than the value of the current row ( 2 ) then highlight row 2 .您面临的问题是您选择了例如范围2:10
(专注于2 )并且例如您正在应用更正的( $
)公式=$A3<>$A2
它会执行预期的操作:它突出显示最后一次出现在一个组中,即如果下一行 ( 3 ) 的值与当前行 ( 2 ) 的值不同,则突出显示第2行。=$A2<>$A1
as correctly posted by user11222393 since the first row you selected is row 2 ie if the value of the previous row ( 1 ) is different than the value of the current row ( 2 ) then highlight row 2 .要突出显示组中的第一次出现,您需要=$A2<>$A1
由user11222393正确发布,因为您选择的第一行是第2行,即如果前一行 ( 1 ) 的值不同于当前行 ( 2 ) 然后突出显示行2 。Usage用法
Select the entire rows of the range and goto Home -> Conditional Formatting -> New Rule -> Use formula...
(you know the drill) and eg use Select 范围内的整行,然后转到Home -> Conditional Formatting -> New Rule -> Use formula...
(您知道这个技巧),例如使用
=COUNTIF($A$2:$A2,$A2)=1
for the first row being row 2.第一行是第 2 行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.