Excel 2013 - Alternate Highlight Rows Based on Cell Data CHANGING

前提是你 提交于 2020-01-03 06:05:08

问题


I don't know much about conditional formatting in Excel. I'd like to be able to use the background color of rows to indicate "groups" of rows. One of the cells (all the same column) determines which "group" the row belongs to. I don't want to associate 1 color per group; instead, I'd like to alternate between 2 (or more?) colors. So, I am content to say, "switch colors when the value of this column changes". (I realize that will only work if I'm sorting on that column, but I am sorting on that column.)

This feels like it should be dead simple, but I haven't been able to figure it out, or even figure out how to google for it.


回答1:


Here's a solution which doesn't use a helper column:

Rule 1: =MOD(SUMPRODUCT(1/COUNTIF($O$1:$O1,$O$1:$O1)),2)=1

Rule 2: =MOD(SUMPRODUCT(1/COUNTIF($O$1:$O1,$O$1:$O1)),2)=0

Important: This assumes that all instances of account numbers are always grouped together - for example it will fail if O7 is changed to "Account 1". I assume this is not an issue since you are sorting on Column O.



来源:https://stackoverflow.com/questions/59306970/excel-2013-alternate-highlight-rows-based-on-cell-data-changing

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