Formula to color cells based on result

V

Vinny

I need to color cell based on five possible outcomes.
example:
If 1 --> "yellow"
If 2 --> "green"
If 3 --> "blue"
If 4 --> "red"
If 5 --> "orange"

Conditional formatting allows me only 3 colors.

I'd like to use the Logical Test but don't know how to tell Excel t
color entire cell if conditions are met.

I was also considering referncing a cell if condition is met so tha
Excel would copy the color of refernced cell.

Can anyone please help me?

Thank
 
D

David McRitchie

Hi Vinny,
Conditional Formatting is certainly the easiest to use and it
does not matter how the value changed, but the limitation of
3 formatting choices per cell is a big limitation.

An example of an Event macro to trigger a change of color based on
manually changing the content of a cell (as opposed to calculated
formulas) can be found in
http://www.mvps.org/dmcritchie/excel/event.htm#case

You may want a macro to change existing cells as well as the
event macro to change color when changes are made later.
http://www.mvps.org/dmcritchie/excel/proper.htm
for an example of providing for both.

This is of course programming and the newsgroup for programming
Excel macros is excel.programming where you would be expected
to know how to install and use macros. For non event related
macros you might visit my page
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top