I’d like to color cells according to their value (cf conditional formatting – color scales) in the style menu of Excel 2007 to newer.
It works fine and the effect is wonderful when you have a wide range of data with fairly distributed values.
However, the column I am formatting conditionally is the result of some computation. Sometimes I get N/A values because one of my input is N/A, and sometimes I get the exception “division by zero” as my cells are the result of a division. In these scenarios, i don’t get any colors at all.
Is there a way to ignore these problematic cells that happen sometimes, leave them blank and process colours for the rest of them ?
Thank you guys ! 😉
A picture of when it works fine : 
Another picture showing a problematic cell cancelling the colouring : 
I’m looking for an Excel solution to the problem, which I can then record as macro to port to my C# application. But if someone has a nice workaround in C#, I’d be happy too (i.e. I use ToColourScalePercentile on the range, I was thinking to maybe remove problematic cells from the range somehow)
you could use IsError function to check if there is N/A and in case there is leave the cell empty, otherwise put the value there.