Articles

Solved change excel cell colour using If

February 17, 2009 at 10:14:38
Specs: Windows Vista, 2GB

hey, in excel 2000 i have set a condition in a cell as follows: IF((A44+C44)<C47,"Pass","Fail") and i would like to know how to turn the cell green if the result is "pass" and red if the result is "fail"

See More: change excel cell colour using If

Report •


#1
February 17, 2009 at 11:55:58

Use Conditional Formatting with the following conditions:

Assuming the cell with the IF statement is A1:

Format...Conditional Formatting

Condition 1
Formula is - =IF(A1="Pass",TRUE,FALSE)
Format...Pattern...Green

Condition 2
Formula is - =IF(A1="Fail",TRUE,FALSE)
Format...Pattern...Red


Report •

#2
February 17, 2009 at 12:42:00
✔ Best Answer

Another way of doing the same thing is with the AND function
This function tests two or more conditions to see if they are all true.
And there can be up to 30 possible tests.

The steps are the same as DerbyDad03 showed but the formula is different.

1st – Select the cell in which your formula is located

On the Menu Bar:

2nd - Format
3rd - Conditional Formatting
4th – Change “Cell Value is” to “Formula Is”
5th – Enter the formula:

=AND((A44+C44)<C47)

Sub Menu Format :
6th - Patterns
7th - Choose Green
8th - Press OK

9th Select ADD
10th – Change “Cell Value is” to “Formula Is”
11th – Enter the formula:

=AND((A44+C44)>C47)

Sub Menu Format :
12th - Patterns
13th - Choose Red
14th - Press OK
15th - Press OK

There is only one test going on here, but with a little imagination, you could do more.

MIKE


Report •

#3
February 17, 2009 at 13:16:28

You may have to change your formula.
As it is you are checking for
Greater Than and Less Than,
but what happens if it is an exact match?

MIKE


Report •

Related Solutions

#4
February 17, 2009 at 13:18:10

That should be -My- formulas, not yours.

MIKE


Report •


Ask Question