Set up conditional formatting so that it goes orange within two cells of a zero entry

agwalsh
agwalsh used Ask the Experts™
on
How can I apply conditional formatting to a sheet so that within 2 cells of it showing zero it goes orange. See desired effect attached sheet.
Thank you :-)
EE-CF-within-distance-of-blank-cell.xlsx
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Select the entire range from C5:N7, then go to Home|Conditional Formatting|New Rule

Select "use a formula to determine which cells to format" and enter formula:

=AND(C5<>0,OR(E5=0,D5=0))

Then click Format and choose from Fill tab.
RayData Analyst

Commented:
The above solves it if you mean within two to the RIGHT.  If you mean within two cells left or right, you need a couple more "OR" items :-)

Great answer from NBVC though!

Author

Commented:
@nbvc. That works well although I just had to tweak the formula to read as follows..(allowing for the different cells I put it into...). Thank you :-)
=AND($F4<>0,OR(G$4=0,H$4=0))

Author

Commented:
Had to tweak it a tiny bit but worked beautifully :-)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial