Reputation: 17647
Here is some demo data:
You can see the formula used in Column B returns TRUE for any consecutive duplicates, but when used as a CF condition on $A$1:$A$14 it returns different results?
Here is the CF setup:
Upvotes: 2
Views: 1040
Reputation: 61945
So the condition shall be true if either the predecessor or the successor is the same value.
Within conditional formatting you can think about the row numbers as circular. So the predecessor of A1
is A1048576
and also the successor of A1048576
is A1
.
The same is with the column numbers. After XFD
follows A
.
So your formula for the conditional formatting is:
=OR(A1048576=A1,A1=A2)
or
=AND(A1<>"",OR(A1048576=A1,A1=A2))
for excluding empty cells.
As sheet formula this will not work. There
=OR(IFERROR(INDIRECT("A"&ROW(A1)-1)=A1,FALSE),A1=A2)
is need.
Upvotes: 2
Reputation: 37125
This may also help you. It will work for whole column also.
=IF(A1="","",OR(A1=A2,A1=IFERROR(OFFSET(A1,-1,0),"")))
Upvotes: 2