Conditional or VBA help!

Anniema

New Member
Joined
Mar 20, 2024
Messages
8
Office Version
  1. 2016
Platform
  1. Windows
Per the image, I am trying to have numbers colour code themselves when entered into specific cells (in this instance in Columns G & O). What colour is dependent on a "Bin" number, bins are in columns A & B, therefore when a bin number is added to the table e.g. 203 in the In table (but could equally be the Out table) it would turn yellow, and eg 302 in the out table bin column auto turns blue. I have looked at various conditional format options to no avail as I do not want to highlight duplicates or lesser/greater than etc options so am struggling to see how to achieve the required results.
XYZ.JPG
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Welcome to the Forum!

You can use a formula in conditional formatting - it's the last option in the dropdown.

So you could do something like this:

ABCDEFG
1Bin 1 Bin 2
2203201
3205202
4207204
5209206
6etcetc
7Bin
8203
9201
10999
11209
12
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G8:G11Expression=COUNTIF($B$2:$B$6,G8)textNO
G8:G11Expression=COUNTIF($A$2:$A$6,G8)textNO
 
Upvote 0
Solution
Thank you so much for your prompt response. I shall away and try it now. :)
 
Upvote 0
Not sure what you meant by this:
I do not want to highlight duplicates
but if you mean that you only want to highlight the found values once, then you could use this variation on @StephenCrump 's solution:

Book1
ABCDEFG
1Bin 1 Bin 2
2203201
3205202
4207204
5209206
6etcetc
7Bin
8203
9201
10999
11209
12201
13206
14206
15
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G8:G15Expression=AND(COUNTIF($A$2:$A$6,G8),COUNTIF($G$8:$G8,G8)<=1)textNO
G8:G15Expression=AND(COUNTIF($B$2:$B$6,G8),COUNTIF($G$8:$G8,G8)<=1)textNO
 
Upvote 0
Welcome to the Forum!

You can use a formula in conditional formatting - it's the last option in the dropdown.

So you could do something like this:

ABCDEFG
1Bin 1 Bin 2
2203201
3205202
4207204
5209206
6etcetc
7Bin
8203
9201
10999
11209
12
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G8:G11Expression=COUNTIF($B$2:$B$6,G8)textNO
G8:G11Expression=COUNTIF($A$2:$A$6,G8)textNO
Worked perfectly, thank you.
 
Upvote 0

Forum statistics

Threads
1,223,902
Messages
6,175,278
Members
452,629
Latest member
SahilPolekar

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