SOLVED

How to automatically change cell's background color by a formula

Copper Contributor

Hello,

I need some little help here, I'd like to write a formula to automatically change a cell's background color when the next cell's content (text or value) is different from the previous cell's content, for example please see the attached picture, 

Annotation 2019-06-04 145306.jpg

As long as the next cell's content is different from the previous cell's content, the next cell's background color will be changed automatically. Does anyone know how to write a formula for this function?? I prefer writing formula instead of creating a rule because by this I can copy and paste this formula to apply to tons of other cells. Thank you sooooo much.

5 Replies

@vividwhp , formulas don't return cell properties as color, only values. That with VBA programming.

 

At the same time the rule with simple formula could be applied to all your tons of cells. If they are in one range that will be only one rule for entire range, otherwise approximately as many as many ranges you have. 

@Sergei Baklan , thank you so much for the reply, i see..........

so.......could you please quickly show me how to create the rule for this function for a entire range??

please take the below example, I attached the file as well.

thank you very very much.

Annotation 2019-06-04 154123.jpg

 

best response confirmed by vividwhp (Copper Contributor)
Solution

@vividwhp , select your range without first column in it, create new conditional formatting rule as

image.png

in formula it shall be relative references starting from top left cell of the range (N5). Apply desired format, Ok, here confirm or change selection

image.png

That's all. You have only one rule to color your entire range, result is

image.png

 

@Sergei Baklan thank you so much you are the best!!!

1 best response

Accepted Solutions
best response confirmed by vividwhp (Copper Contributor)
Solution

@vividwhp , select your range without first column in it, create new conditional formatting rule as

image.png

in formula it shall be relative references starting from top left cell of the range (N5). Apply desired format, Ok, here confirm or change selection

image.png

That's all. You have only one rule to color your entire range, result is

image.png

 

View solution in original post