Format change

S

sungen99

How would I change the background color to green from red if the valu
of a1 is greater and the value of b1?

Thanks for your help,
Ke
 
S

swatsp0p

With A1 the active cell (and red fill color), select Format>Conditiona
Formatting...

Set Condition 1 to 'Cell Value Is' Greater Than B1 click th
Pattern tab and choose your fill color (green?) and click OK

Does this work for you
 
S

sungen99

how about if i want to make the background blue if its 1/4 of a1 or red
if its 1/2 of a1 or green if its 3/4 of a1? can u do this??
 
D

David McRitchie

Use the Formula instead for your Conditional Formatting, see
http://www.mvps.org/dmcritchie/excel/condfmt.htm

You will need to set up 3 formula for each of the three colors
Depending on whether you only want B1 to change color,
or the entire column to be checked or the entire row to be
colored you will have to modify relative and absolute address.
If you mean specifically A1 then use $A$1 otherwise you
could use the following just to color cell B1, and thing in the
B column or any row based on the value in the B cell of that row.
The cell B1 must be the active cell when creating the C.F
(actually with $Bn any cell on row 1 could be the active cell).

Formula 1: =AND($B1*4=$A1, ISNUMBER($B1)) format as blue (pattern color)
Formula 2: =AND($B1*2=$A1,ISNUMBER($B1)) format as red
Formula 3: =AND($B1=(3/4*$A1),ISNUMBER($B1)) format as green

If you want more than 3 colors (+ default) you will have to use an Event macro
or use the Extended Conditional formatting addin see the reference above.

FWIW, use of ExcelForum makes searching of websites very difficult
for everyone because ExcelForum dumps newsgroup postings into webpages.
 
Top