Cell text and background colour dependant on result

D

Darren

To simplify my problem, I will narrow down the results.

The result of a calculation is shown as a percentage. Is it possible to
format the cell to display the result in different colours dependant on it's
value?

Example:
Below 50% - White background, green text
50% and over - Yellow background and red text.
 
T

T. Valko

You can do this with conditional formatting. How you apply it depends on
what version of Excel you're using.

Assume the cell of interest is A1

For Excel 2007:

Select cell A1
Goto Home tab>Styles>Conditional Formatting>Manage rules>New rule>Use a
formula to determine which cells to format
Enter this formula in the box below:
=AND(COUNT(A1),A1<0.5)
Click the Format button
Select the Font tab
Select a shade of GREEN
OK>OK

New rule>Use a formula to determine which cells to format
Enter this formula in the box below:
=AND(COUNT(A1),A1>=0.5)
Click the Format button
Select the Font tab
Select a shade of RED
Select the Fill tab
Select a shade of YELLOW
OK out

For other versions of Excel:

Select cell A1
Goto the menu Format>Conditional Formatting
Condition 1
Select the Formula Is option
Enter this formula in the box on the right:
=AND(COUNT(A1),A1<0.5)
Click the Format button
Select the Font tab
Select a shade of GREEN
OK

Click the Add button

Condition 2
Select the Formula Is option
Enter this formula in the box on the right:
=AND(COUNT(A1),A1>=0.5)
Click the Format button
Select the Font tab
Select a shade of RED
Select the Patterns tab
Select a shade of YELLOW
OK out
 

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