The problem is that the function does not recalculate when you
change the fill color. You can force it to recalculate by selecting
the cell with the formula, pressing F2, then ENTER. I haven't found
a better way, so the function may not be too usefull...