Why does this excel formula return different results for conditional formatting?

限于喜欢 提交于 2019-12-11 00:38:41

问题


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:


回答1:


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.




回答2:


This may also help you. It will work for whole column also.

=IF(A1="","",OR(A1=A2,A1=IFERROR(OFFSET(A1,-1,0),"")))



来源:https://stackoverflow.com/questions/34706068/why-does-this-excel-formula-return-different-results-for-conditional-formatting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!