Different colours for specific cells.

Geek Girl 007

Board Regular
Joined
Mar 12, 2022
Messages
127
Office Version
  1. 2021
Platform
  1. Windows
I've set this up to change colour for specific Letters, but I also want it to be for specific Cells, i.e.
If i select P in H3, G3 and H3 will go RED
If I select N in J3, I3 and J3 will go GREEN

1676145951786.png

I selected the cells G and H 3 and put in this formula in:
=$H3="P"
=$H3="N"


I selected the cells I and J 3 and put in this formula in:
=$J3="P"
=$J3="N"

However it changed all of the formulas to the ones directly above.

TEST (1).xlsx
ABCDEFGHIJ
1TotalFebruary
2NumerSurnameFirst nameActivityNEGPOSDateN/PDateN/P
311PN
Sheet3
Cell Formulas
RangeFormula
E3E3=COUNTIF(G3:J3,"N")
F3F3=COUNTIF(G3:J3,"P")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G3:J3Expression=$J3="P"textNO
G3:J3Expression=$J3="N"textNO
Cells with Data Validation
CellAllowCriteria
H3List=Text!$A$1:$A$2
J3List=Text!$A$1:$A$2
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
XL2BB - i didnt get across the Conditional formatting

so

your selecting G3:J3 but you need to setup 2 rules with 2 different selections
otherwise it will just apply the first rule
and colour the cells all the same
then move onto the next rule
andcolour ALL the cells the next rule colour


If i select P in H3, G3 and H3 will go RED
If I select N in J3, I3 and J3 will go GREEN

2 rules need to be setup

first
select G3 and H3
then put
=$H3="P"
exit

then
select I3 and J3
then
$J3="N"
exit

Book6
ABCDEFGHIJ
1
2
3pn
4
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I3:J3Expression=$J3="N"textNO
G3:H3Expression=$H3="P"textNO
 
Last edited:
Upvote 0
If i select P in H3, G3 and H3 will go RED
If I select N in J3, I3 and J3 will go GREEN

2 rules need to be setup

first
select G3 and H3
then put
=$H3="P"
exit

then
select I3 and J3
then
$J3="N"
exit

Book6
ABCDEFGHIJ
1
2
3pn
4
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I3:J3Expression=$J3="N"textNO
G3:H3Expression=$H3="P"textNO
Hi There,
Thank you so much for replying so fast..... I want it to be an either/or i.e.
Whatever I select in cell, either N or P in H3 then G/H would go the corresponding colour.
also Whatever I select in cell, either N or P in J3 then I/J would go the corresponding colour.

Basically I want it to reset per column.
Can this be done??
 
Upvote 0
oh, OK , so it depends on which cell you clck the mouse into - is that what you mean , When you "select"
if so then its VBA thats needed , as the trigger is the cell being selected

I dont provide VBA solutions - sorry ,

hopefully another member will help
 
Upvote 0
oh, OK , so it depends on which cell you clck the mouse into - is that what you mean , When you "select"
if so then its VBA thats needed , as the trigger is the cell being selected

I dont provide VBA solutions - sorry ,

hopefully another member will help
Thank you
 
Upvote 0
I selected the cells G and H 3 and put in this formula in:
=$H3="P"
=$H3="N"


I selected the cells I and J 3 and put in this formula in:
=$J3="P"
=$J3="N"
It does not look like that is exactly what you did, otherwise you would not have one rule covering 4 cells like this

1676162123437.png


I followed the steps stated in the quote above and applied red for P and green for N and this is what I got.
Note the four CF rules, two for each pair of columns.

23 02 12.xlsm
GHIJ
2DateN/PDateN/P
3PN
CF3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I3:J3Expression=$J3="N"textNO
I3:J3Expression=$J3="P"textNO
G3:H3Expression=$H3="N"textNO
G3:H3Expression=$H3="P"textNO
 
Upvote 0
It does not look like that is exactly what you did, otherwise you would not have one rule covering 4 cells like this

View attachment 85203

I followed the steps stated in the quote above and applied red for P and green for N and this is what I got.
Note the four CF rules, two for each pair of columns.

23 02 12.xlsm
GHIJ
2DateN/PDateN/P
3PN
CF3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I3:J3Expression=$J3="N"textNO
I3:J3Expression=$J3="P"textNO
G3:H3Expression=$H3="N"textNO
G3:H3Expression=$H3="P"textNO
It didn't work for me, but I realize that I was being too fancy :)
I found that it was just better to do it this way:
1676225974974.png
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,692
Members
449,117
Latest member
Aaagu

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