Conditional Formatting Help

ItalianPlatinum

Well-known Member
Joined
Mar 23, 2017
Messages
795
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hello I have what I thought was an easy modification, but having issues finding an easy way to solution. I have 3 columns one column is pre, one is post, and the 3rd is differences. I have existing conditional formatting in column C to highlight red if the data isn't zero and green if the data is zero. The new condition i was looking to add is if any data below the header equals zero to highlight the header green and if any don't equal zero to highlight the header red.

PrePostDifferences
12-1
110
220
34-1

So in this scenario "Differences" would be shaded red as well as the first and last record. If those records were zero then all 5 in column C would be shaded green including the header "Differences." Any help is much appreciated as always.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
@Joe4 , i'm a goob.
No worries! It happens to all of us. Sometimes, you get so far down a path that you can lose the forest for the trees!
Sometimes it helps to take a step back adn re-examine the question. Being away overnight gave me a fresh perspective.
 
Upvote 0
i am so sorry. Here is a corrected version:
mr excel questions 17.xlsm
ABC
1PrePostDifferences
2120
3110
4220
5340
ItalianPlatinum
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1Expression=COUNTIF(C2:C5,0)=(COUNTA(C:C)-1)textNO
C2:C5Expression=(C2=0)textNO
C2:C5Expression=(C2<>0)textNO
C1Expression=COUNTIF(C2:C5,">0")>0textNO




mr excel questions 17.xlsm
ABC
1PrePostDifferences
2123
3113
4223
5343
ItalianPlatinum
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1Expression=COUNTIF(C2:C5,0)=(COUNTA(C:C)-1)textNO
C2:C5Expression=(C2=0)textNO
C2:C5Expression=(C2<>0)textNO
C1Expression=COUNTIF(C2:C5,">0")>0textNO



mr excel questions 17.xlsm
ABC
1PrePostDifferences
2121
3110
4220
5343
ItalianPlatinum
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1Expression=COUNTIF(C2:C5,0)=(COUNTA(C:C)-1)textNO
C2:C5Expression=(C2=0)textNO
C2:C5Expression=(C2<>0)textNO
C1Expression=COUNTIF(C2:C5,">0")>0textNO
 
Upvote 0
If you want it to be red if at least one is not zero, you could use:
Excel Formula:
=COUNT(C2:C5)-COUNTIF(C2:C5,"0")>0
or more simply:
Excel Formula:
=COUNTIF(C2:C5,"<>0")>0
ok seems to be working with one odd item. my conditional is green with black font. but its green with white font? I tried expanding with larger dataset to see how it will operate with my live data
1679575347634.png
 
Upvote 0
ok seems to be working with one odd item. my conditional is green with black font. but its green with white font?
Go back and check the formatting portion of that green CF rule.
Check the Font tab and see what you have the color set to. If you want it to stay blank, it should be "Automatic".
1679575764682.png
 
Upvote 0
i am so sorry. Here is a corrected version:
mr excel questions 17.xlsm
ABC
1PrePostDifferences
2120
3110
4220
5340
ItalianPlatinum
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1Expression=COUNTIF(C2:C5,0)=(COUNTA(C:C)-1)textNO
C2:C5Expression=(C2=0)textNO
C2:C5Expression=(C2<>0)textNO
C1Expression=COUNTIF(C2:C5,">0")>0textNO




mr excel questions 17.xlsm
ABC
1PrePostDifferences
2123
3113
4223
5343
ItalianPlatinum
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1Expression=COUNTIF(C2:C5,0)=(COUNTA(C:C)-1)textNO
C2:C5Expression=(C2=0)textNO
C2:C5Expression=(C2<>0)textNO
C1Expression=COUNTIF(C2:C5,">0")>0textNO



mr excel questions 17.xlsm
ABC
1PrePostDifferences
2121
3110
4220
5343
ItalianPlatinum
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1Expression=COUNTIF(C2:C5,0)=(COUNTA(C:C)-1)textNO
C2:C5Expression=(C2=0)textNO
C2:C5Expression=(C2<>0)textNO
C1Expression=COUNTIF(C2:C5,">0")>0textNO
Thanks this one looks to be working I am going to implement to my live test
 
Upvote 0
I spoke too soon. few things. the hearder isnt red with 1 record flagging. and how do I solution blank cells that i could have in my data set. Do i just create another conditional format to clear out if any blank cells and place it last?

1679586015331.png
 
Upvote 0
try using this formula then:
=COUNTIF(C2:C5000,0)=COUNTA(C2:C5000)
 
Upvote 0
Go back and check the formatting portion of that green CF rule.
Check the Font tab and see what you have the color set to. If you want it to stay blank, it should be "Automatic".
View attachment 88240
I noticed if I don't do stop if true it'll flag green shade and white font. BUT if i do stop if true for the GREEN it does the correct conditional shading (green shade and automatic font). is that weird to you?
 
Upvote 0

Forum statistics

Threads
1,215,873
Messages
6,127,454
Members
449,383
Latest member
DonnaRisso

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