Conditional Formatting Positive & Negative Number

Data123

Board Regular
Joined
Feb 15, 2024
Messages
71
Office Version
  1. 365
Platform
  1. Windows
Hi I am looking for a way to color positive numbers green and negative numbers red, but as the value becomes greater for green or less for red so does the intensity of the color. Also, I would like to copy this format for other columns and those + and - numbers will range greatly between columns (see below). Lastly, is there a way to choose the min and max green and red for the range of color? Thanks!

Column 1
500
200
100
0
-4
-500

Column 2
4
3
2
0
-1
-4

Zero could be colored white.
 
Last edited:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
There isn't a single rule that will be able to do what you want. You would have to create multiple rules to do it, one for each separate color.
 
Upvote 0
There isn't a single rule that will be able to do what you want. You would have to create multiple rules to do it, one for each separate color.
thanks, would the individual rules be able to be based on percentile of + or - numbers? like 1/3rd of the top positive numbers would be colored dark green, then middle 1/3rd of + numbers less dark and bottom 1/3rd lightest green? if so can you tell me how to input the first one please?
 
Upvote 0
Something like this for the positive values:
1708454771148.png
 
Upvote 0
Then that is where you are going to have to make individual rules for each color level.

Perhaps something like this then:
Book1
ABCDE
1MaxMax
25004
3500411
420030.40.75
510020.20.5
60000
7-20-1-0.04-0.25
8-500-4-1-1
Sheet4
Cell Formulas
RangeFormula
D3:D8D3=A3/$A$2
E3:E8E3=B3/$B$2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3:B8Expression=AND(A3/A$2>-0.33,A3/A$2<0)textNO
A3:B8Expression=AND(A3/A$2>-0.66,A3/A$2<=-0.33)textNO
A3:B8Expression=A3/A$2<=-0.66textNO
A3:B8Expression=AND(A3/A$2>0,A3/A$2<0.33)textNO
A3:B8Expression=AND(A3/A$2>=0.33,A3/A$2<0.66)textNO
A3:B8Expression=A3/A$2>=0.66textNO


Where A2 and B2 are the max, and then you can divide each row by the max to get your percentile. Columns D & E showing the results of the division to give you an idea how I set it up.
 
Upvote 0
Solution
thank you! may i ask would this setup be able to automatically deal with values that change daily? meaning the colors would still stay red for negative numbers and green for positive numbers as the values change?
 
Upvote 0
thank you! may i ask would this setup be able to automatically deal with values that change daily? meaning the colors would still stay red for negative numbers and green for positive numbers as the values change?
Yes, CF rules still apply to the cell no matter what the value is, and you're welcome.
 
Upvote 0
may i ask can you explain columns D and E from your table above please? it looks like a percentile value of the highest and lowest value. i have 5 columns with 850 cells each that i am looking to add conditional formatting to.
 
Upvote 0
may i ask can you explain columns D and E from your table above please? it looks like a percentile value of the highest and lowest value. i have 5 columns with 850 cells each that i am looking to add conditional formatting to.
Columns D & E in my example are just for reference. The values in those columns are already figured into the CF formulas, I only put them on the sheet to see them and compare to the highlighting in columns A & B. But yes, that is how I was figuring the percentile values compared to the maximum values set in A2 and B2.

Example changed the max in column B from 4 to 20:
Book1
ABCDE
1MaxMax
250020
3500410.2
420030.40.15
510020.20.1
60000
7-4-1-0.008-0.05
8-500-4-1-0.2
Sheet4
Cell Formulas
RangeFormula
D3:D8D3=A3/$A$2
E3:E8E3=B3/$B$2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3:B8Expression=AND(A3/A$2>-0.33,A3/A$2<0)textNO
A3:B8Expression=AND(A3/A$2>-0.66,A3/A$2<=-0.33)textNO
A3:B8Expression=A3/A$2<=-0.66textNO
A3:B8Expression=AND(A3/A$2>0,A3/A$2<0.33)textNO
A3:B8Expression=AND(A3/A$2>=0.33,A3/A$2<0.66)textNO
A3:B8Expression=A3/A$2>=0.66textNO
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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