Reputation: 163
I am trying to color Column A based on its percentage of value in Column B. Column B value could be 3, 6, 9 or 12, so I cannot just take a raw number as the minimum, mid or maximum value, it has to be a percentage. And I would like to do this without inserting an extra column which calculates the percentage. Below is an image with how the two columns may look like.
What works is adding an extra column in which the percentage is calculated using the formula:
=TO_PERCENT(A2/B2)
with the Color Scale Conditional Formatting looking something like this:
But I don't want an extra column showing the percentage, I would rather color the numbers in Column A based on what percentage they are of Column B. What I thought would work is the following:
The formulas being:
=TO_PERCENT($A2/$B2)>=0%
=TO_PERCENT($A2/$B2)>=50%
=TO_PERCENT($A2/$B2)>=100%
With or without TO_PERCENT
, as you can see, the result is the same - everything under the midpoint, which should be red, is actually green. I am unsure as to what is causing this, nor how to fix this or if there is any feasible alternative to properly color scale based on value's percentage of another value.
Upvotes: 0
Views: 1356
Reputation: 10187
You shouldn't use Colour scaling like that. Consider that even if it analyses it, an expression like =TO_PERCENT($A2/$B2)>=0%
will actually return 0 when false and 1 when true, so it's not going to be comparable to your columns
It's a little uncomfortable, but what you should do is to create your own scaling by setting each of your formulas to each desired colour. Keep in mind the order of the rules, the highest values should go up
Upvotes: 1