Conditional formatting cell color based on a number range.

Rixn

Board Regular
Joined
Jun 4, 2005
Messages
119
Office Version
  1. 2021
Platform
  1. Windows
In conditional formatting I can only get multiple cells to be colored with a range of colors from a gradient from one color to another (or via a third color).

I want to set the background color of one cell, based on the number that is entered, and the range in numbers should pick the color value based on the same kind of a gradient one can have in conditional formatting.

Example: If the number range is 1-5 and the color range goes from red to yellow to blue, then the fallout of the numbers should be the following:

1: red
2: orange
3: yellow
4: green
5: blue


It should work also if I change the number range (like 1 to 100).
Preffrable without VBA.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Have you looked at Conditional Formatting -> Color Scales?
 
Upvote 0
Here is the color scales dialog entry that @Cubist was suggesting:
this only uses three colors though. So it doesn't have the green you asked for.
1710423868242.png
 
Upvote 0
Here is the color scales dialog entry that @Cubist was suggesting:
this only uses three colors though. So it doesn't have the green you asked for.
View attachment 108366
Yes, I have tried it. But it is limiting as it only shows the different colors when you have multiple cells.
I want only one cell that get the color of these numbers (shown by awoohaw).
So when that cell have number 50 it will be yellow, and for 75 i will be green.
That is, the color value between the chosen colors for Midpoint and Maximum.
 
Last edited:
Upvote 0
I am confused by your question then. In the example above, if you change the value in any of those cells the color will also change. The example did use the sequence function, but you can paste that as values and then change any of the numbers as you like.

Mr Excel Questions 75.xlsm
ABCDEFGHIJ
112345678910
211121314151617181920
321222324252627282930
431323334353637383940
541424344454647484950
651525354555657585960
761626364656667686970
871727374757677787980
981828384858687888990
10919293949596979899100
Sheet4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:J10Other TypeColor scaleNO
 
Upvote 0

Forum statistics

Threads
1,215,076
Messages
6,122,983
Members
449,092
Latest member
Mr Hughes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top