ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Color a calculated percentage cell text red if results negative (https://www.excelbanter.com/excel-discussion-misc-queries/188075-color-calculated-percentage-cell-text-red-if-results-negative.html)

John

Color a calculated percentage cell text red if results negative
 
I have a spread sheet containing columns Budget, Expense, Variance and %
Variance in cols A, B, C and D. Col D contains formulas of the form =C10/A10.

What code would I add to color negative percentage cell text red?

Thx for your help, John

Eric

Color a calculated percentage cell text red if results negative
 
Highlight appropriate cells; Format-conditional formatting-"Cell Value Is"
"less than" "0", then hit the format button and format appropriately.

"John" wrote:

I have a spread sheet containing columns Budget, Expense, Variance and %
Variance in cols A, B, C and D. Col D contains formulas of the form =C10/A10.

What code would I add to color negative percentage cell text red?

Thx for your help, John


MyVeryOwnSelf

Color a calculated percentage cell text red if results negative
 
I have a spread sheet containing columns Budget, Expense, Variance and
% Variance in cols A, B, C and D. Col D contains formulas of the form
=C10/A10.

What code would I add to color negative percentage cell text red?


One way:
Format Cells Number Custom

and under "Type" put
0.00%;[Red]0.00%

Vary to suit.

(I have Excel 2003.)

MyVeryOwnSelf

Color a calculated percentage cell text red if results negative
 
I have a spread sheet containing columns Budget, Expense, Variance and
% Variance in cols A, B, C and D. Col D contains formulas of the form
=C10/A10.

What code would I add to color negative percentage cell text red?


One way:
Format Cells Number Custom

and under "Type" put
0.00%;[Red]0.00%


Or even better:
0.00%;[Red]-0.00%


All times are GMT +1. The time now is 08:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com