Highlighting cell contents, based on a range

wherethegoalsat

New Member
Joined
Aug 23, 2024
Messages
5
Office Version
  1. 2011
Platform
  1. Windows
Hi

I am trying to work out how to create a formula/conditional formatting for duplication. The conditions are as follows. (from the image)

1. Grey box is know as 'contents', Yellow box is 'New Lot'.
2. So IF the cell contents, in the yellow box matches ANY of the cell contents in the grey box, then BOTH of the cells would highlight (so red text for example).
3. If there are 2 matching cells in the grey box, then it WONT highlight the cells, as its only concerned with a match in the yellow box

In the example in the picture, i would expect to see
* fridge highlighted in cells A4 & A12
* saw highlighted in cells C5 & A14
* bed in cells C6 & A7 to NOT be highlighted

The thinking long term, is that the yellow 'new lot' section will constantly change and i can see whats a duplicate of the contents (grey section.).

Hope this made sense... not sure if its achievable.
 

Attachments

  • spreadsheet example.png
    spreadsheet example.png
    15.8 KB · Views: 14

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
@wherethegoalsat Welcome.

Does the below help?

Book1
ABC
1HouseGarageShed
2
3CookerBenchlawnmower
4FridgeBikeBike
5ShelfTVSaw
6ComputerBed
7Bed
8
9
10New Lot
11bed
12Fridge
13Light
14saw
15Bowl
Sheet12
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A11:A15Expression=AND(A11>"",COUNTIF($A$2:$C$7,A11))textNO
A2:C7Expression=AND(A2>"",COUNTIF($A$10:$A$15,A2)=1)textNO
 
Upvote 0
that would work GREAT :)

right... need to find out how to apply that conditional formatting now on the web version
 
Upvote 0
ok, so i have modified the formula and applied it to the real spreadsheet... but im getting errors... some text night highlighting (numbers) and some blank cells highlighting.

can you tell me whats wrong with what i have done?
 

Attachments

  • PROBLEM 1.png
    PROBLEM 1.png
    98.7 KB · Views: 6
Upvote 0
It will help if you can use the XL2BB link below. Download that add-in and use it to post a mini-sheet of the section of your sheet as per your image.
Ensure that you tick in the XLBB sub menu to include conditional formatting.
 
Upvote 0
Also, can you identify the cells of that dataset that you expect to be CF highlighted?
 
Upvote 0
Didn't you want bed NOT to be highlighted?
Try this:

Book6.xlsx
ABC
1HouseGarageShed
2
3CookerBenchlawnmower
4FridgeBikeBike
5ShelfTVSaw
6ComputerBed
7BedLight
8
9
10New Lot
11bed
12Fridge
13Light
14saw
15Bowl
16
17
Sheet4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A11:A1000Expression=SUM(COUNTIF(A11, $A$3:$C$7))*(SUM(COUNTIF(A11, $A$3:$C$7))<2)textNO
A3:C7Expression=SUM(COUNTIF(A3, $A$11:$A$1000))*(SUM(COUNTIF(A3, $A$3:$C$7))<2)textNO
 
Last edited:
Upvote 0
Actually the formula for the new lot CF can be simplified:

Book6.xlsx
ABC
1HouseGarageShed
2
3CookerBenchlawnmower
4FridgeBikeBike
5ShelfTVSaw
6ComputerBed
7BedLightLight
8
9
10New Lot
11bed
12Fridge
13Light
14saw
15Bowl
16
Sheet4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A11:A1000Expression=SUM(COUNTIF(A11, $A$3:$C$7))=1textNO
A3:C7Expression=SUM(COUNTIF(A3, $A$11:$A$1000))*(SUM(COUNTIF(A3, $A$3:$C$7))<2)textNO
 
Upvote 0
Didn't you want bed NOT to be highlighted?
Try this:

Book6.xlsx
ABC
1HouseGarageShed
2
3CookerBenchlawnmower
4FridgeBikeBike
5ShelfTVSaw
6ComputerBed
7BedLight
8
9
10New Lot
11bed
12Fridge
13Light
14saw
15Bowl
16
17
Sheet4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A11:A1000Expression=SUM(COUNTIF(A11, $A$3:$C$7))*(SUM(COUNTIF(A11, $A$3:$C$7))<2)textNO
A3:C7Expression=SUM(COUNTIF(A3, $A$11:$A$1000))*(SUM(COUNTIF(A3, $A$3:$C$7))<2)textNO

i did want bed to NOT be highlighted yes... so that solution looks great, i have modified it to my master spreadsheet and again its failing.... i must be doing something wrong when i try and re-populate the cell details (see pic).... also i have been trying to install XL2BB, but its against company policy and wont allow it.

in the image you can see 'yansa' not highlighting.. and triple threat.
 

Attachments

  • error2.png
    error2.png
    131.4 KB · Views: 2
Upvote 0
Try this

here is the working file to download:

CondiFormat.zip

Book6.xlsx
ABCDEFGHIJKL
1HouseGarageShed
2
3
4CookerBenchlawnmower
5FridgeBikeBike
6ShelfTVSaw
7ComputerBed
8BedLightLight
9Yansa
10
11
12
13
14
15
16
17
18
19
20
21bed
22Fridge
23Light
24saw
25Bowl
26Yansa
27
28
29
30
Sheet4 (2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B21:B999Expression=SUM(COUNTIF(B21, $B$4:$K$18))=1textNO
B4:K17Expression=SUM(COUNTIF(B4, $B$21:$B$999))*(SUM(COUNTIF(B4, $B$4:$K$18))<2)textNO
 
Upvote 0
Solution

Forum statistics

Threads
1,223,885
Messages
6,175,184
Members
452,615
Latest member
bogeys2birdies

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