ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   color of cell fill (https://www.excelbanter.com/excel-worksheet-functions/160953-color-cell-fill.html)

janlanac

color of cell fill
 
I want to set up a mathmatical formula that will fill a cell with a specific
color that corresponds to the value the formula returns. For instance, if
the formula returns 99 - the cell would be green, if 70 it would be yellow
and if < 60 it would be red. Anyone know how to accomplish this?
--
jan

Pete_UK

color of cell fill
 
You can do this with Format | Conditional Format while the cell is
selected (assume it is A1). Then in the panel that pops up you can
choose Formula Is rather than Cell Value Is and enter the formula:

=A1=99

(I'm assuming you want 99 or above), then click the Format button on
the panel, select the Patterms tab and choose Green, then OK. Then
click Add and set up a similar condition for:

=A1=70

and choose a yellow background, then OK and Add, and then finally your
third condition:

=A1<60

and select a Red background. Click OK twice to come out of the CF
panel.

Your normal background colour would be applied if the value in A1 is
=60 and <70.


Hope this helps.

Pete

On Oct 5, 12:28 am, janlanac
wrote:
I want to set up a mathmatical formula that will fill a cell with a specific
color that corresponds to the value the formula returns. For instance, if
the formula returns 99 - the cell would be green, if 70 it would be yellow
and if < 60 it would be red. Anyone know how to accomplish this?
--
jan




Barb Reinhardt

color of cell fill
 
Try using Format - Conditional Format

This will work for 3 or fewer condions. If you have more than 3 conditions,
you'll need to do it with VBA.
--
HTH,
Barb Reinhardt



"janlanac" wrote:

I want to set up a mathmatical formula that will fill a cell with a specific
color that corresponds to the value the formula returns. For instance, if
the formula returns 99 - the cell would be green, if 70 it would be yellow
and if < 60 it would be red. Anyone know how to accomplish this?
--
jan



All times are GMT +1. The time now is 02:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com