# Conditional formatting in excel 2007

Solved/Closed
NS - Feb 9, 2011 at 03:31 PM
Toast - Feb 16, 2011 at 10:05 PM
Hello,
I am trying to apply conditional formatting to a calculated cell (For ex A).

Criteria: If Cell A value = Cell B or " - " then dont apply any conditional formatting. Else, highlight the cell in Red.

I thikn it is simple but for some reason i am not able to apply conditional formatting with this rule/formula. Please help ASAP.

Thx

Related:

## 1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Feb 9, 2011 at 03:41 PM

you need to do some thing like this

=AND(\$A1<>\$B1,OR(\$A1<>"",\$B1<>""),AND(\$A1<>" - ",\$B1<>" - "))
Thank you so much..it worked. Another question..is there a shortcut to apply this formula to column or rows without copy and pesting? I have like 20 rows and 6 columns..:(

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Feb 9, 2011 at 04:05 PM
Lets say you want to apply this rule to column A and B fully
then click of Cell A1 first
then select column A and B
go to conditional format and apply the formula for A1 cell
It will copy for next rows on its own. Basic idea is that first you select the first cell of the range, then select your range and finally you apply the format condition for that row or column (depends on what you want) but the first cell of the range
I selected E11 to K11 cells and applied formatting formula of... =AND(\$E\$11<>\$E\$39,OR(\$E\$11<>" - "))....

But it still shows same formula when i check formula for F11...instead it should be...... =AND(\$F\$11<>\$F\$39,OR(\$F\$11<>" - "))....

When i try removing \$ sign; i.e ... =AND(E\$11<>E\$39,OR(E\$11<>" - "))....it didnt work either.