Conditional Formatting

ziad alsayed

Well-known Member
Joined
Jul 17, 2010
Messages
665
dear all

need to apply conditional formatting to the below data

if data in column F<0 to color in red
if data in column F >0 and<=5% to color in green
if data in column F >=5% and<10% to color in blue
if data in colomn F >=10% to color in pink

the problem i am facing is that some data Show #Value so i used iferror to eliminate them. when applying condotinal to such cells let say >10% ,they will be colored though they are empty.

appreciate any help
Excel Workbook
DEF
131 640 0001 748 0006.59%
141 950 0002 088 0007.08%
152 200 0002 349 0006.77%
162 570 0002 734 0006.38%
17No RangeNo Range
183 270 0003 531 0007.98%
194 100 0003 875 000-5.49%
204 500 0004 758 0005.73%
FGW ref
Excel 2010
Cell Formulas
RangeFormula
F13=IFERROR((E13-D13)/D13,"")
F14=IFERROR((E14-D14)/D14,"")
F15=IFERROR((E15-D15)/D15,"")
F16=IFERROR((E16-D16)/D16,"")
F17=IFERROR((E17-D17)/D17,"")
F18=IFERROR((E18-D18)/D18,"")
F19=IFERROR((E19-D19)/D19,"")
F20=IFERROR((E20-D20)/D20,"")
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Would it help if your first formula rule is

=ERROR.TYPE(F1)=3

3 is the #VALUE! error constant and I assume F1 is the first cell in column F that you are evaluating, further assuming with all these conditions you are using version 2007 or 2010.
 
Upvote 0
I assumed when you wrote this:

if data in column F <0 to color in red
if data in column F >0 and <=5% to color in green
if data in column F >=5% and <10% to color in blue
if data in colomn F >=10% to color in pink

that it represented conditional formatting rules you have already established as part of conditional formatting for those cells. My suggestion was to have your first rule be, in your syntax

if data in column F is a #VALUE! error then no color

and the actual formula for that rule is what I posted:
=ERROR.TYPE(F1)=3

which, just like with any formula rule such as you already have, you'd assign a pattern color to it as you did the 4 others, but in this case the color is no color when that error condition is met.
 
Upvote 0
dear tom

thanks for the explanation, i tried it and didn't work, i put as the first condition and add the others.

maybe it didn't work because of the iferror that is making the cell to show empty.

please advise.
 
Upvote 0
dear all

need to apply conditional formatting to the below data

if data in column F<0 to color in red
if data in column F >0 and<=5% to color in green
if data in column F >=5% and<10% to color in blue
if data in colomn F >=10% to color in pink

the problem i am facing is that some data Show #Value so i used iferror to eliminate them.
Excel Workbook
DEF
131 640 0001 748 0006.59%
141 950 0002 088 0007.08%
152 200 0002 349 0006.77%
162 570 0002 734 0006.38%
17No RangeNo Range
183 270 0003 531 0007.98%
194 100 0003 875 000-5.49%
204 500 0004 758 0005.73%
when applying condotinal to such cells let say >10% ,they will be colored though they are empty.
#VALUE!
Excel 2010
Cell Formulas
RangeFormula
F13=IFERROR((E13-D13)/D13,"")
F14=IFERROR((E14-D14)/D14,"")
F15=IFERROR((E15-D15)/D15,"")
F16=IFERROR((E16-D16)/D16,"")
F17=IFERROR((E17-D17)/D17,"")
F18=IFERROR((E18-D18)/D18,"")
F19=IFERROR((E19-D19)/D19,"")
F20=IFERROR((E20-D20)/D20,"")
For that condition use something like this...

=AND(COUNT(F13),F13>=0.1)

On a side note...

You're not accounting for values that are equal to 0.

You test for less than and greater than but not equal to.
 
Upvote 0

Forum statistics

Threads
1,224,589
Messages
6,179,744
Members
452,940
Latest member
rootytrip

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