Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a dataset like this in Excel:

  A  B
1 X  X
2 X  Y
3 Y  X
4 Y  Y

I want to set up conditional formatting such that rows 1 and 4 will be highlighted as green because their A and B cells are the same. The same formatting should highlight rows 2 and 3 red because their A and B cells are different.

How can I do that?

I know I can create a new column using the formula A1=B1 to generate TRUE or FALSE, then use the new column for highlighting, but I don't want to do an extra step.

share|improve this question
up vote 2 down vote accepted

I think a picture is worth several words here. Use the formula you mentioned, and its opposite, for the conditional formatting formulas.

conditional formatting example

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.