# Thread: Conditional Formatting two cells when they are equal to a certain value Thanks: 0 Likes: 0

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

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.

2. ## Re: Conditional Formatting two cells when they are equal to a certain value

Originally Posted by BrSuthe
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:

3. ## Re: Conditional Formatting two cells when they are equal to a certain value

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"))`

4. ## Re: Conditional Formatting two cells when they are equal to a certain value

Originally Posted by BrSuthe
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.

 A B C 1 2 S0 S0 TRUE

 Cell Formula C2 =AND(\$A2="S0",\$B2="S0")