0

I need to conditionally format all values between 2 numbers in a pivot table using a color gradient to accentuate the scale of values between that range.

I'd like to not have any color for the rest of the cells that do not fall between these particular values.

enter image description here

I tried doing this using the formatting from the above picture but as you can see values outside of those indicated are still being highlighted (.48 is highlighted even though the maximum is supposed to be -.05).

enter image description here

I also tried using formulas in the three-color gradient to use different colors to highlight each range I want to differentiate. But an error comes up saying "You cannot use relative references in Conditional Formatting criteria for color scales, data bars and icon sets".

Any ideas? Thanks.

0

1 Answer 1

1

Adding 2 rules for conditional formatting before your 'main' conditional formatting, I got this result.

Cell Value < lower limit - no formatting;

Cell Value > upper limit - no formatting;

Make sure to select 'stop if true' on these first 2 rules.

Results

Sign up to request clarification or add additional context in comments.

6 Comments

Thanks but that didn't work. When I do that it does color the selected range but it is not a gradient. I'm guessing because the column I'm using is a lot more than 17 rows so those 31 values I'm looking for are all in the same 'gradient zone'? I need the formatting to apply only to those values between the two values, not the whole range of the column. This is a refreshable sheet also so I can't just highlight a smaller set of cells.
I suppose you still need the non-coloured data? Otherwise, you could apply a filter and show the data somewhere else.
I am going to make three distinct gradient zones based on % ranges (ex. 0-10, 10-20, 20-30), the smallest being red gradient, the second being yellow gradient, the third being green gradient. But all information would have to be included, yes. Thanks.
file:///C:/Users/greeleym/OneDrive%20-%20Legrand%20France/Desktop/Screenshot%202025-08-21%20100053.png
You can't upload screenshots to comments, if you think it's important for future readers to understand your problem, you can edit it into your original question. I'm sorry the solution didn't work, I'll try to see if I can come up with something else. Are you okay with adding a helper column or even VBA?
I know I tried to chuck that photo into an additional reply as it was not allowing me to post in the comment.... No problem I appreciate you! I'd accept a helper column and definitely VBA. Anything that gets to the answer. I would eventually like to get to the point where I can have different colored gradients correspond to different range numbers...For example: 1-100: red gradient 100-200: yellow gradient 200-300: green gradient But that might be a different question. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.