Conditional format stoplight for #Div/0! error

stct80

Board Regular
Joined
Apr 26, 2010
Messages
59
Happy Autumn!

I am trying to flag a cell, pointing to 2 different cells, if the following condition is met:

1. For cell A1: If(C1-C2)/C1>.15 --> Red stoplight.
2. For cell A1: If(C1-C2)/C1>.05 --> Yellow stoplight.
3. For cell A1: If(C1-C2)/C1<=0.05 --> Green stoplight.

This is working fine with the Conditional format.

Issue:

If Cell C1 = 0 (i.e. Denominator is 0), I get a standard error #Div/0! (which is technically correct per the excel logic).


I would like to show same set of indicators, even if the Denominator = 0. I know this may contradict the logic, but the objective is to flag if the C2 value is lower than C1, for dashboard reporting.

Can I get some help?

Thank you and Regards...
 
So you're doing

IF C2 is more than 15% less than C1 = Red
If C2 is more than 5% less than C1 = Yellow
If C2 is less than 5% less than C1 = Green

Try

=IF(C1=0,C2,(C1-C2)/C1) > 0.15 - Red
=IF(C1=0,C2,(C1-C2)/C1) > 0.05 - Yellow
=IF(C1=0,C2,(C1-C2)/C1) < = 0.15 - Green

Hi Jonomo1,

thank you for the reply. I am trying to use the Conditional formatting through Icon indicators. Where should I put this equation? I could not locate field to enter this equation for Icon stoplights, and hence the question.

Please advise..
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I don't think you'll be able to use icon sets for this.
They can only work on their own cells
A1 will choose the icon based on A1's value.
A1 can't can't chose the icon based on values in C1

Further, even if you chose to put them in C1, you can't use relative references in the icon set rules, only absolute hard coded values. (I don't know why)

The best you can do is the usual fill color, or borders or font etc..
 
Upvote 0
I'm not entirely sure I follow where on the sheet you're trying to enter these formulas, but as a simple solution why not add something really small to C1, say 0.000001, ie some orders of magnitude less than your expected figures in C1 or C2. This will avoid the error condition and your formating will work. To do this simply replace '../C1' with '.../(C1+0.000001)'

HTH
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top