Friday, May 11, 2007

Conditional formatting and the N() function

Just discovered something new with Conditional Formatting. Maybe you Excel gurus already know about the N() worksheet function, but figured I'd share anyway, just in case. Feel free to scoff at my unworthy Excel skills.

In my project, I have a standard output worksheet set up with references to a linked sheet. I want to use conditional formatting to highlight any value greater than 0. Simple right? Well, when I use the following setting:



The result looked like this:



That's not what I wanted. The blank cells shouldn't be highlighted. So it's a simple change to check for the blank cells, right?



This didn't work either. The cells $M3:$M10 are not blank, they contain a formula that references the linked sheet. So the 1st condition returns false.

And unfortunately, Conditional Formatting doesn't let you reference another worksheet within a formula, so I couldn't use =ISBLANK('report(tblAnalyzerStats)'!M3)

The solution was to use the N() worksheet function. I'd never heard of that before:



The results ended up exactly like I wanted:



Hope this is new for at least one of you. Have a great weekend!

2 comments:

Kevin Bennett said...

Ah, very nice. I've always had issues with "blanks" cells not being ISBLANK() because of formulas. The N() function could help with those...

Emily Ligotti said...

N() kidding, great insight