Google Spreadsheets: Alternating Background Color on Value Change?

前端 未结 6 957
别那么骄傲
别那么骄傲 2020-12-31 07:51

there are lots of topics about Conditional Formatting in Google Spreadsheets, but not one like what I\'m looking for.

All I want to do is set an alt

6条回答
  •  长发绾君心
    2020-12-31 08:31

    The only way I can see this working is to make a new column. This can be hidden if you want.

    Throw this formula in any new column and autofill down:

    =IFERROR(IF(A1<>INDIRECT("A"&ROW()-1),IF(INDIRECT(CHAR(COLUMN()+64)&ROW()-1)=0,1,0),INDIRECT(CHAR(COLUMN()+64)&ROW()-1)),1)
    

    Change A1 as needed to the start of your data. You can also replace the INDIRECT(...) with offset but then you have to tell it what column you put the formula in. So to give an example doing it that way; if you put it in column B:

    =IFERROR(IF(A1<>INDIRECT("A"&ROW()-1),IF(OFFSET(B1,-1,0)=0,1,0),OFFSET(B1,-1,0)),1)
    

    This formula gives us a column of 0's and 1's that will tell us either to make the background colored or leave it white.

    So in your conditional formatting just apply it to the desired range and use "Custom formula is":

    =$B1
    

    Chose formatting as desired

提交回复
热议问题