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

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Try placing your formula in some blank cells just to see what they return, i.e.
Excel Formula:
=COUNTIF(C2:C5,0)

What value does it return?

Also, in your region, what does Excel use as argument separators? Commas or semi-colons?
If semi-colons, then your formula will need to look like:
Excel Formula:
=COUNTIF(C2:C5;0)
 
Upvote 0
right kind of what I was trying to show you :) that it isnt working for me.....
Regarding your Post #7. You only have two of the conditional formulas displayed.
And all you have is the fill colors reversed, if you reverse the fill colors for the conditional formatting in Cell C1, then you should get a correct CF.
 
Upvote 0
I hope this explains it better:
mr excel questions 17.xlsm
ABCDEFG
1PrePostDifferencesCF Formula to paste into CFInto CF dialog for these cells
212-1FALSE=COUNTIF(C2:C5,0)=0C1Makes C1 GREEN when all are zero
3110TRUE=COUNTIF(C2:C5,0)>0C1Makes C1 RED when at least one is not zero
4220TRUE=(C2<>0)C2, then copy formatMakes C2 GREEN when C2 zero
534-1FALSE=(C2=0)C2, then copy formatMakes C2 RED when C2 is not zero
ItalianPlatinum
Cell Formulas
RangeFormula
D2D2=COUNTIF(C2:C5,0)=0
E2:E5E2=FORMULATEXT(D2)
D3D3=COUNTIF(C2:C5,0)>0
D4D4=(C2<>0)
D5D5=(C2=0)
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
Regarding your Post #7. You only have two of the conditional formulas displayed.
And all you have is the fill colors reversed, if you reverse the fill colors for the conditional formatting in Cell C1, then you should get a correct CF.
i copied your formulas exactly. do you see one that is different than how you have it? and yes i didnt do c2:c5 yet as I am trying to get C1 to work first
 
Upvote 0
Try placing your formula in some blank cells just to see what they return, i.e.
Excel Formula:
=COUNTIF(C2:C5,0)

What value does it return?

Also, in your region, what does Excel use as argument separators? Commas or semi-colons?
If semi-colons, then your formula will need to look like:
Excel Formula:
=COUNTIF(C2:C5;0)
1679571263222.png


Shows as zero and i never have used semi-colons so comma should be it.
 
Upvote 0
Icannot see the entire formula. Are you sure you copied/typed it completely?
Excel Formula:
=COUNTIF(C2:C5,0)=0
 
Upvote 0
Icannot see the entire formula. Are you sure you copied/typed it completely?
Excel Formula:
=COUNTIF(C2:C5,0)=0
The objective of typing the CF formula in a "practice" cell is to get to where your return values of TRUE or FALSE, although any non zero number is TRUE, and 0 is FALSE, I like to be sure see TRUE or FALSE, it doesn't leave room for ambiguity.
 
Upvote 0
I hope this explains it better:
mr excel questions 17.xlsm
ABCDEFG
1PrePostDifferencesCF Formula to paste into CFInto CF dialog for these cells
212-1FALSE=COUNTIF(C2:C5,0)=0C1Makes C1 GREEN when all are zero
3110TRUE=COUNTIF(C2:C5,0)>0C1Makes C1 RED when at least one is not zero
4220TRUE=(C2<>0)C2, then copy formatMakes C2 GREEN when C2 zero
534-1FALSE=(C2=0)C2, then copy formatMakes C2 RED when C2 is not zero
ItalianPlatinum
Cell Formulas
RangeFormula
D2D2=COUNTIF(C2:C5,0)=0
E2:E5E2=FORMULATEXT(D2)
D3D3=COUNTIF(C2:C5,0)>0
D4D4=(C2<>0)
D5D5=(C2=0)
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
little confused your first picture shows conditional formatting green
Icannot see the entire formula. Are you sure you copied/typed it completely?
Excel Formula:
=COUNTIF(C2:C5,0)=0
1679571615392.png
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,681
Members
449,116
Latest member
HypnoFant

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