Conditional formatting with 2 variables

LadyTemplate

New Member
Joined
Jul 12, 2022
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
Hi đź‘‹ New member so bear with me!

I am trying to get my conditional format to highlight orange when 2 criteria are met, i.e. if column J says "RBC" and then if so whether any data in column B is a duplicate for these rows only.

I have tried
=IF(AND(J7="RBC",COUNTIF(B7:B200,$B7)>1,1,0)

This gives the below output, but it should be highlighting B9 orange too, as J7 and J9 ="RBC", and B7 and B9 are duplicates. B10 and B11 should not be highlighted as they are different in column J. Similarly B8 should not be highlighted as J8<>"RBC"

Screenshot_20220712-193120_Gallery.jpg


Not sure where I've gone wrong! Send help!
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
One thing I noticed right off the bat.
Since you are trying to apply this to multiple rows, you need to lock down the rows in your COUNTIF formula, i.e.
=IF(AND(J7="RBC",COUNTIF(B$7:B$200,$B7)>1,1,0)
 
Upvote 0

Forum statistics

Threads
1,214,631
Messages
6,120,640
Members
448,974
Latest member
DumbFinanceBro

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