Link to home
Start Free TrialLog in
Avatar of morinia
moriniaFlag for United States of America

asked on

changing color font in Excel in if Statement - Excel 2010

Experts,

Is there a way to change the color of the font in an if statement relative to if the calculation is negative or positive.

I would like to put this statement in columnd d14

If (d14-AVERAGE($d14:$G14) < 0 then  ...........

I would like to change the font  in D14 to red if negative and green if positive.
Avatar of Kimputer
Kimputer

I think you have yourself a circular reference.
In any case, after you solve that, use Conditional Formatting (new rule, based on formula, one for D14>-1, and one for D14 <0)
SOLUTION
Avatar of Harry Lee
Harry Lee
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Barry,

You method works somewhat. With a formula situation, the only cell that's affected is D14. With you method, the whole range D14:G14 is affected.

As stated in the question, only D14 should be affected but not the average range.
Hello Harry,

That's true

I assumed that morinia would want to format the whole range so that each value will be coloured according to whether it's above or below average.....

...perhaps I'm wrong but morinia seemed happy with that solution :)

regards, barry