How do I make an IF statement change cell shading

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I a make an IF statement change the color of the cell based on the
number inputted? For example I want 0-5 to be clear, 5-10 to be yellow, 10+
to be red. I want to also change the text properties to change the color of
the text. Can either be done?
 
Hi

It is called conditional formatting.
on the menu -> Format -> Conditional format.

think about it. How would you use an if statement to change the shading
of that same cell while still having a value in that cell that's
independant of the if statement. So the bottomline is, whatever change
the shading of the cell HAS to be seperate from the cell value.
Therefore you can't controll it with a if but have to use conditional
formatting.

Rgds
CE AUKE
 
Not with an IF in the cell. What you could do is use the same IF Formula in
Conditional Formatting and change the format accordingly.

Regards

Trevor
 
Hi there Binglesworth,

For your text, format the cell as you would normally format any cell. We'll
let that be our "default" format. Then, with the cell selected, go to Tools
| Conditional Formatting. You can add up to 2 more conditional formats, set
your cell values in the given drop downs to specified, change the format for
each condition to that which you want and click Ok.

HTH
 
hi!

select your range (say A1:A10)

goto Format >> Conditional Formatting >>
condition 1 : select Formula Is: =A1<=5 format as your wish
then Add >>
condition 2 : select Formula Is: =AND(A1>5,A1<=10) format as
you like
again Add>>
condition 3: select Formula Is =A1>10 format as per your choice


-via135
 
Hi!

Use conditional formatting.

Your ranges overlap:

0-5 to be clear
5-10 to be yellow

If the number is 5 what color should it be? Clear or yellow?

Select the cell in question. I'll assume it's A1.
Goto format>Conditional Formatting
Condition 1
Formula is: =AND(ISNUMBER(A1),A1>10)
Click the Format button
Select the desired style(s)
OK
Click the ADD button
Condition 2
Formula is: =AND(ISNUMBER(A1),A1>=6)
Clcik the format button
Select the desired style(s)
OK out

Biff
 

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

Back
Top