Conditional Formatting Problem

Cliffork

New Member
Joined
Feb 12, 2020
Messages
43
Office Version
  1. 365
I'm having a bit of a problem with conditionally formatting a few cells based on 2 points of data. If neither is filled in at all, I want this cell to remain blank. If one of the two is filled in, I want it to turn red to show me that the other one wasn't completed. If both are filled in I want it to be green. My problem in the case below is that for some reason, the first conditional rule is still taking over the formatting when it is false, and showing blank. If I delete this rule, the red and green portions function correctly, but the one to clear it messes the whole thing up.

If the fact that this jumps around to a different pages confuses things I can remake it on one page, but I'll wait and see first.

Meter Repair Compilation File -Template.xlsm
IJKL
10New Serial #On Pre-estimate?
110 
Checklist
Cell Formulas
RangeFormula
I10:I11I10='Final Insp.'!D80
K11K11=IF(ISNUMBER('Pre-Estimate'!D16),"True","False")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K11Expression=AND(LEN(I11<5),K11="False")textNO
K11:K14Cell Valuecontains "false"textNO
K11:K14Cell Valuecontains "true"textNO
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
I am not sure I understand - K11 is a formula that returns a "True" or "False", so it cannot ever be blank.

And what formatting does your first Conditional Formatting Rule (the expression one) apply?
 
Upvote 0
I am not sure I understand - K11 is a formula that returns a "True" or "False", so it cannot ever be blank.

And what formatting does your first Conditional Formatting Rule (the expression one) apply?

Sorry I guess it didn't include that part of the formatting in the xl2bb code.
The formatting makes it blank. It says if I11 has less that 5 characters, AND K11 is false (which just means a cell on the pre-estimate page is left blank) that it formats the cell as ;;; , which just makes the cell text invisible.

My desire was to make it so that if either the serial number is filled in(always more than 5 digits) or the cell is not blank on the pre-estimate page, that this conditional formatting would stop taking place, but it doesn't until both things are false. It almost seems to be working as an OR instead of as AND.
 
Upvote 0
I think it is because it looks like you have an error in your expression.
Instead of:
Excel Formula:
=AND(LEN(I11<5),K11="False")
it should be:
Excel Formula:
=AND(LEN(I11)<5,K11="False")
 
Upvote 0
Solution
In addition to fixing the parenthesis in the formula.
The first rule must have Stop = true
Also check the range Applies to:

varios 17oct2024.xlsm
IJK
10New Serial #On Pre-estimate?
11abTrue
12abcdefTrue
13abFalse
14abcdefFalse
Checklist
Cell Formulas
RangeFormula
I10I10='Final Insp.'!D80
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K11:K14Expression=AND(LEN(I11)<5,K11="False")textYES
K11:K14Expression=K11="False"textNO
K11:K14Expression=K11="True"textNO
 
Upvote 0
In addition to fixing the parenthesis in the formula.
The first rule must have Stop = true
Also check the range Applies to:

varios 17oct2024.xlsm
IJK
10New Serial #On Pre-estimate?
11abTrue
12abcdefTrue
13abFalse
14abcdefFalse
Checklist
Cell Formulas
RangeFormula
I10I10='Final Insp.'!D80
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K11:K14Expression=AND(LEN(I11)<5,K11="False")textYES
K11:K14Expression=K11="False"textNO
K11:K14Expression=K11="True"textNO
I never understood what stop if true did before until I just looked it up. I think it was working without it, but I'm going to leave it checked anyways.

The range will apply to all the other cells, I was just working on this one first before applying it to the rest that have the color ones already.
 
Upvote 0
I think it is because it looks like you have an error in your expression.
Instead of:
Excel Formula:
=AND(LEN(I11<5),K11="False")
it should be:
Excel Formula:
=AND(LEN(I11)<5,K11="False")
This was it, I just didn't realize I had the end parenthesis in the wrong spot. Thanks!
 
Upvote 0
This was it, I just didn't realize I had the end parenthesis in the wrong spot. Thanks!
You are welcome.

Yes, the way it was written, it was comparing the VALUE in I11 to the number 5, and would return either TRUE or FALSE, and then taking the length of that result!
 
Upvote 0
I never understood what stop if true did before until I just looked it up. I think it was working without it, but I'm going to leave it checked anyways.

According to my tests, if you hold down the stop it doesn't set the color correctly:

With out:
varios 17oct2024.xlsm
IJK
10New Serial #On Pre-estimate?
11abTrue
12abcdefTrue
13abFalse
14abcdefFalse
Checklist
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K11:K14Expression=AND(LEN(I11)<5,K11="False")textNO
K11:K14Expression=K11="False"textNO
K11:K14Expression=K11="True"textNO



With:
varios 17oct2024.xlsm
IJK
11abTrue
12abcdefTrue
13abFalse
14abcdefFalse
Checklist
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K11:K14Expression=AND(LEN(I11)<5,K11="False")textYES
K11:K14Expression=K11="False"textNO
K11:K14Expression=K11="True"textNO
 
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,094
Members
453,021
Latest member
Justyna P

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