I am making a report that requires me to display some calculations as a percentage. Basically, I'm doing a database query for records matching a specific ID. The number returned becomes my denominator for my calculation. Of this set of records, the number that meet a second condition becomes my numerator.
Obviously, if no records are returned in the first query, then I'll have a denominator of 0, which inevitably leads to a Divide-by-Zero error if I try to calculate a percentage out of this. As of right now, I have my function checking if the denominator is zero, and if true, I return a value of "0%" for this calculation.
Normally, I'd be satisfied with 0/0 = 0% since nothing is being calculated, so "nothing" should be returned. The problem is introduced when I have to color code the output based on the percentage. Suddenly I'm seeing a lot of red(0%) or a lot of green(100%) results, depending on how I grade 0/0.
Should somebody quickly glance at my list of percentages, they'll see "Oh, everything is green. Ok, good." Or they'll see "Oh no, everything is red. This isn't good."
This report is going to be a summary of my department's resources. It will be read by many heads of departments and such who don't care about specifics and just want a summary of my division. They have asked for percentages specifically, color-coded to red = 0%, green = 100%, and anything in-between shown as some combination of those colors. If they see a lot of red, that can have bad implications towards our department. If they see a lot of false greens, that could turn out worse.
I showing the actual percentage along with the fraction I'm using, but I'm afraid that they might simply glance at the report and only see the colors.
What is the most understandable way to display these results?