Conditional Formatting two cells when they are equal to a certain value

BrSuthe

New Member
Joined
Feb 10, 2018
Messages
29
This may seem simple to you, but I'd like to get a little help on this please.
I have A and B columns. I'm trying to format the two adjacent cells when they have the value "S0".

What I tried is this formula:

Code:
=And ($A2="S0", $B2="S0")

But this formula doesn't give me the result I want.

What am I doing wrong? thanks.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
This may seem simple to you, but I'd like to get a little help on this please.
I have A and B columns. I'm trying to format the two adjacent cells when they have the value "S0".

What I tried is this formula:

Code:
=And ($A2="S0", $B2="S0")

But this formula doesn't give me the result I want.

What am I doing wrong? thanks.

The formula works for me.

And what data do you have in A2 and B2?
And what do you have in Applies to:
 
Upvote 0
I have values like S0, S1, S2, S3, S4 in these two columsn. I use this formula to be exact =AND($BD14="S0",$BE14="S0")
The first 13 rows are empty. On my sheet, it highlights but it is like randomly. It highlights S3 and S0 too.

in these two columns I have this formula :
Code:
=IF(COUNTIF($AA14:$AH14,"S")=0,"S0","S"&COUNTIF($AA14:$AH14,"S"))
 
Last edited:
Upvote 0
I have values like S0, S1, S2, S3, S4 in these two columsn. I use this formula to be exact =AND($BD14="S0",$BE14="S0")
The first 13 rows are empty. On my sheet, it highlights but it is like randomly. It highlights S3 and S0 too.

in these two columns I have this formula :
Code:
=IF(COUNTIF($AA14:$AH14,"S")=0,"S0","S"&COUNTIF($AA14:$AH14,"S"))


If you really have S0 in A2 and B2, then the formula in C2 will return True.

<table border="1" cellspacing="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:76.04px;" /><col style="width:76.04px;" /><col style="width:78.89px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >A</td><td >B</td><td >C</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td style="background-color:#92d050; ">S0</td><td style="background-color:#92d050; ">S0</td><td style="text-align:right; ">TRUE</td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b></b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formula</td></tr><tr><td >C2</td><td >=AND($A2="S0",$B2="S0")</td></tr></table></td></tr></table>
 
Upvote 0

Forum statistics

Threads
1,213,497
Messages
6,114,002
Members
448,543
Latest member
MartinLarkin

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