Color a cell based on its value

TCL28

New Member
Joined
Oct 31, 2005
Messages
12
Goodafternoon,
Is it possible to color cell B1 red if cell A1 contains a 0 and color B1 green if A1 contains a 1? Thank you.


Tom
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Use Format|Conditional Formatting while in B1

Formulais, a1=0 choose your format,

Then, click Add

Formulais, a1=1, choose your format.
 
Upvote 0
Use conditional formatting.

Select B1 and go to Format\Conditional Formatting

Enter

Formula Is | =AND(ISBLANK($A$1)=FALSE,$A$1=0)
and click the Format button to set the color to red.

Click the "Add>>" button to add another condition.
Enter:
Formula is | =$A$1=1
and click the format button to set the color to green.
 
Upvote 0

Forum statistics

Threads
1,203,199
Messages
6,054,081
Members
444,702
Latest member
patrickmg17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top