Solved Color of cell or font color in cell change

August 16, 2013 at 12:54:40
Specs: Windows 7
I would like to know what if statement to make so that the results are as follows: IF a1<a2 then either the color of cell a1 would change color of the font of the information in cell a1 wouled change color.

See More: Color of cell or font color in cell change

Report •


#1
August 16, 2013 at 13:06:17
✔ Best Answer
An IF statement in a cell will not change the color of the cell or the font. You need to use Conditional Formatting or a macro. Conditional Formatting was designed for this very task.

Assuming Excel 2007 or later, these fine instructions - stolen without permission from mmcconaghy - should work for you.

1) Select A1
2) On the Ribbon, Select Home Tab
3) On the Home Ribbon, click Conditional Formatting
4) Click on New Rules, it’s near the bottom of the dialog box
5) Click "Use Formula to determine which cells to format"
6) Enter this formula:

=A1<A2

6) Click on the Format button
7) Select the Fill tab or the Font tab
8) Select a Format. You can apply more than one format if you wish by choosing different tabs.
9) Click OK
10) Click OK

Conditional Formating is based on the results of the formula that is entered in the CF Wizard. Whenever the formula returns TRUE, the Conditional Formatting is applied to the cell.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

message edited by DerbyDad03


Report •

#2
August 16, 2013 at 13:08:17
What your looking for is Conditional Formatting.

Try this:

Conditional Formatting 2007

1) Select your cell or range of cells, IE A1
2) On the ribbon click Conditional Formatting
3) Click on New Rules, it’s near the bottom of the dialog box.
4) Click Use Formula to determine which cells to format.
5) Enter the formula:

=IF(A1<A2,True,False)

6) Click on the Format button
7) Select the Fill Tab
8) Select a pretty color
9) Click OK
10) Click OK


See how that works for you.

EDIT:

DerbyDad03, got there two minutes before me...... :-)

MIKE

http://www.skeptic.com/

message edited by mmcconaghy


Report •

#3
August 16, 2013 at 13:13:56
Thanks for your help

Report •

Related Solutions

#4
August 17, 2013 at 13:13:13
Mike,

Keep in mind that CF (and Excel in general) will automagically return TRUE or FALSE for an equality or inequality function. There's no need for a full IF statement.

In CF or in a cell you can use =A1=A2 or =B1>B2, etc. and Excel will determine if it's TRUE or FALSE.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#5
August 17, 2013 at 13:24:31
I know, but sometimes I think the OP might not,
so I do it OLD style so as not to confuse.

MIKE

http://www.skeptic.com/


Report •

#6
August 17, 2013 at 19:49:00
Ah, but the "old way" was never really the only way. Excel always evaluated those functions as TRUE or FALSE but users apparently thought that the full IF was required for CF. It never really was.

See this write-up, which was related to Excel 2000 (old, right?) in which our expert friend Chip Pearson suggests...

"...you can use the formula =IF(B1>10,TRUE,FALSE) , or, more simply, =B1>10"

http://www.cpearson.com/excel/cform...

Even Microsoft suggests using the short version of a formula to return TRUE or FALSE in versions 2003 and earlier, which can only go back to 97 when CF was introduced.

http://support.microsoft.com/kb/182189

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

message edited by DerbyDad03


Report •

Ask Question