Conditional Formatting Help

ItalianPlatinum

Well-known Member
Joined
Mar 23, 2017
Messages
793
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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Try using the COUNTIF formula in your Conditional Formatting to count the number of zeroes.
 
Upvote 0
Try this:
mr excel questions 17.xlsm
ABC
1PrePostDifferences
212-1
3110
4220
534-1
6
ItalianPlatinum
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1Expression=COUNTIF(C2:C5,0)=0textNO
C2:C5Expression=(C2=0)textNO
C2:C5Expression=(C2<>0)textNO
C1Expression="COUNTIF(C2:C5,0)=0"textNO
C1Expression=COUNTIF(C2:C5,0)>0textNO
 
Upvote 0
Try this:
mr excel questions 17.xlsm
ABC
1PrePostDifferences
212-1
3110
4220
534-1
6
ItalianPlatinum
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1Expression=COUNTIF(C2:C5,0)=0textNO
C2:C5Expression=(C2=0)textNO
C2:C5Expression=(C2<>0)textNO
C1Expression="COUNTIF(C2:C5,0)=0"textNO
C1Expression=COUNTIF(C2:C5,0)>0textNO
i don't know why there is a 5th format.. let me find out which is not good.
 
Upvote 0
here is a better version:

mr excel questions 17.xlsm
ABCD
1PrePostDifferences
212-1
3110
4220
534-1
6
ItalianPlatinum
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1Expression=COUNTIF(C2:C5,0)=0textNO
C2:C5Expression=(C2=0)textNO
C2:C5Expression=(C2<>0)textNO
C1Expression=COUNTIF(C2:C5,0)>0textNO
 
Upvote 0
For some reason I am not getting the same results as you I will troubleshoot a bit to make sure not a me issue
 
Upvote 0
see anything i dont see?

1679521686491.png
 
Upvote 0
when you created those conditional formats was Cell C1 selected? I know it says "applies to" may mean you were in that cell.
When I create CF formulas, I create the formula in a worksheet cell. So for example i would type in Cell D1, =COUNTIF(C2:C5,0)=0... and when that says TRUE then I know I have my GREEN color correct. Copy the formula from withing the cell. Select cell C1, then add the conditional formatting rule. Just be sure the absolute/relative cell references are correct.

But, to answer your question, I do not see what could be wrong.
 
Upvote 0
It looks like you got it. Good job! But I thought you wanted Green when there were all zeros?
 
Upvote 0

Forum statistics

Threads
1,215,214
Messages
6,123,665
Members
449,114
Latest member
aides

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