Color-coding a field based on calculated percent
Hi, All!
I am trying to color-code a calculated field. It's a percentage field: Count divided by Number Held.
I stole this formula and adapted it from another post, but can't seem to find it again to put the link in this post.
If(
[Count]/[Number Held] > 0.1,
"<div style=background-color:Black>" & ToText([Count]/[Number Held]) & "</div>",
[Count]/[Number Held] > 0.02,
"<div style=background-color:Red>" & ToText([Count]/[Number Held]) & "</div>",
[Count]/[Number Held] > 0,
"<div style=background-color:Yellow>" & ToText([Count]/[Number Held]) & "</div>",
[Count]/[Number Held] <= 0,
"<div style=background-color:LightGreen>" & ToText([Count]/[Number Held]) & "</div>",
ToText([Count]/[Number Held]))
This gets me most of the way there. But I'd like to display ToText([Count]/[Number Held]) as a percent (desired) or, at the very least, multiply it by 100 and round to 2 decimal places. Multiplying by 100 doesn't seem to change the result and rounding gets me all kinds of error messages.
Desired result attached.
Thanks in advance!
------------------------------
Patricia Malarkey
------------------------------