Conditional Formatting not working properly with AND function

Cliffork

New Member
Joined
Feb 12, 2020
Messages
43
Office Version
  1. 365
Hello,

I'm trying to create a quick check for a process document I use in my lab to ensure serial numbers are being applied in 4 places and they all have the correct serial number. Two are entered manually (row 1/2) and two are pulled from other sheets (row 3/4). I have the conditional formatting set to turn the fill color green if they all match, or remain yellow if they aren't all filled in yet. For some reason though, even though the formula is pulling TRUE, it is only formatting one cell green and I cannot for the life of me figure out why it is acting that way. Any suggestions?

New Envision Compilation -Template-.xlsx
ABCDE
68Back Housing2408301B
69Bluetooth2408301B
70Eeproms2408301B
71Paperwork2408301B
Final Inspection Re-Check
Cell Formulas
RangeFormula
D70D70=RIGHT('2nd Values Capture'!A7,LEN('2nd Values Capture'!A7)-13)
D71D71='Cal Form'!K8
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D68:E71Expression=AND(D68=D69,D69=D70,D70=D71)textNO
D68:E70Cell Value=0textYES
D71:E71Cell Value=0textYES
D68:E71Cellcontains an errortextNO
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Since you are trying to apply it across all four rows and across two columns, you would need to lock down the range references in your formulas, i.e.
Excel Formula:
=AND($D$68=$D$69,$D$69=$D$70,$D$70=$D$71)
 
Upvote 1
Solution
I also want to make a point that my other formatting isn't affecting this. I recreated it on fresh cells and just typed a in all three with the same result. Maybe I just need a suggestion on a different way to do this altogether?
New Envision Compilation -Template-.xlsx
KL
69aTRUE
70a
71a
Final Inspection Re-Check
Cell Formulas
RangeFormula
L69L69=AND(K69=K70,K70=K71)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K69:K71Expression=AND(K69=K70,K70=K71)textNO
 
Upvote 0
Since you are trying to apply it across all four rows and across two columns, you would need to lock down the range references in your formulas, i.e.
Excel Formula:
=AND($D$68=$D$69,$D$69=$D$70,$D$70=$D$71)
This worked! I do not understand what that did at all, but it did work. What does adding the $ actually change?
I did try something similar earlier since I'm using merged cells, but it reacts the same way on a fresh set of 3 cells like I showed in my other comment.
 
Upvote 0
It locks down the range reference it is before (the row or column).

For example, if you selected cells K69:K71, and then enter in the formula:
Excel Formula:
=L69
Excel will check cell K69 to see if it is the same as cell L69.
For your other two cells in your selected range, it will automatically change the formula to flow with the range, so that:
cell K70 will be compared to the value in L70 and
cell K71 will be compared to the value in L71.

However, what if we wanted ALL three cells to be compared to just L69?
Then to keep the row portion of our formula from "floating" as we move down rows, we need to lock the row portion like this:
Excel Formula:
=L$69

For a deeper explanation, see here: Switch between relative and absolute references - Microsoft Support.
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,120
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