Link to home
Start Free TrialLog in
Avatar of darrennelson
darrennelson

asked on

Excel Function Based On Cell Color

is there a way to change the value of a cell based on the cell color of another cell?

Example:  If I have the following (fig1), then I set E1's fill color to red, i then want the x's to change to W's(fig2)

fig1
     a     b     c     d     e
1   x             x    x

fig2
     a     b     c     d     e
1   W           W   W    RED


thanks
Avatar of byundt
byundt
Flag of United States of America image

Automatically changing the value in a cell based on the color in another cell is not possible with either worksheet formulas or VBA code. It would be possible to change the values if you are willing to run a macro.  The macro is a lot easier to write if the red color results from the user manually changing cell color (as opposed to Conditional Formatting).  The macro will also depend on the version of Excel that you are using.

The better solution, however, may be to change the color of E1 because you change the value of cell A1 to W.  You can do this using Conditional Formatting and a Formula criteria like $A1="W"

Cells C1 and D1 could change to W either using worksheet formulas or a Worksheet_Change event macro.
Changing the colour manually does not trigger any event in excel that i know of. I would like to know why you want to changing the colour to control something instead of the other way around.

If the colour controls it you should technically have to decide what colour red will do it too, or a range of redish colours will need to be defined. what if the usual red rgb(255,0,0) is accidentally changed by a user to say rgb(255,5,5) which will probably look about the same but do you still call it red for the calculation purpose?
You might be interested in this solution:

http:/Q_26847621.html

Dave
ASKER CERTIFIED SOLUTION
Avatar of dlmille
dlmille
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of darrennelson
darrennelson

ASKER

haha, it's a simple football pool.  I'm tinkering with your file, dlmille, and it does exactly what im trying to accomplish.  Now I just have to figure out you did that.

basicall, I have each matchup in adjacent columns.  I enter everyone's picks with an X.  On monday, I want to highlight the winning team and have all the correct picks change to W's.  Then another formula totals everyone's wins.

it's total overkill for what I'm doing, but I can never leave anything 'as is'....

thanks