Conditional Format not acting as expected.

MiniFav

Board Regular
Joined
Mar 10, 2020
Messages
83
Office Version
  1. 365
Platform
  1. Windows
I have the following.

Hard time template idea.xlsx
BC
33Pos test (dupes)Other field test
3411
3512
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B34:C35Expression=IF(COUNTIF($B$34:$B$35,B34)>1,IF(COUNTIFS($B$34:$B$35,B34,$C$34:$C$35,"<>")>=2,TRUE,FALSE),FALSE)textNO


I would expect each cell to be highlighted, however C35 does not seem to be affected.

The theory behind this is Column B could have duplicate entries,
if there is duplicates then I want to check column C,
If Column C has a different data (not duplicate) then to highlight to indicate an issue.

I have a feeling I am using COUNTIFS wrong and should probably be mixing it with some match and index in some way.
Just looking for some fresh eyes to point me in the right direction.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
What does the second IF criteria mean in the second countifs?
IF(COUNTIFS($B$34:$B$35,B34,$C$34:$C$35,"<>")>=2
 
Upvote 0
What does the second IF criteria mean in the second countifs?
IF(COUNTIFS($B$34:$B$35,B34,$C$34:$C$35,"<>")>=2
I was looking for rows which have the same column B then have any character in Column C and if its greater than two instances to highlight it to me. If its just one instance then thats fine.

I have made a work around.


Everything I want highlighted is now highlighted.

Hard time template idea.xlsx
ABC
33Check MACPos test (dupes)Other field test
34DIFFERENCE1b
35DIFFERENCE1a
Sheet1
Cell Formulas
RangeFormula
A34:A35A34=IF(COUNTIFS($B$34:$B$35,B34,$C$34:$C$35,"<>")>1,IF(COUNTIF($C$34:$C$35,VLOOKUP(B34,$B$34:$C$35,2,0))=1,"DIFFERENCE",FALSE))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B35:C35Expression=IF($D35=TRUE,TRUE,FALSE)textNO
B34:C35Expression=IF($A34="DIFFERENCE",TRUE,FALSE)textNO


Then if there is just one instance its cleared.

Hard time template idea.xlsx
ABC
33Check MACPos test (dupes)Other field test
34FALSE1b
35FALSE1
Sheet1
Cell Formulas
RangeFormula
A34:A35A34=IF(COUNTIFS($B$34:$B$35,B34,$C$34:$C$35,"<>")>1,IF(COUNTIF($C$34:$C$35,VLOOKUP(B34,$B$34:$C$35,2,0))=1,"DIFFERENCE",FALSE))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B35:C35Expression=IF($D35=TRUE,TRUE,FALSE)textNO
B34:C35Expression=IF($A34="DIFFERENCE",TRUE,FALSE)textNO
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,151
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