Excel, Change the color of the cell if the two rows matches

calendar_today Asked Mar 5, 2014
thumb_up 13 upvotes
history Updated April 16, 2026

Question posted 2014 · +6 upvotes

Basically, I have two sets of data.

I want to check if the value in column A, is the same value in Column B.

And if they are not, change the color of these cells.

For example:

http://i60.tinypic.com/2ai203l.png

Column I, Column AA both have the value of a the first month in years from 1318 till 1500 “Arabic Calender” but I want to check which of these values doesn’t match and color them with yellow for example.

In this case, both cells in row 3 should have a different color after the checking operation.

Is there a way to do that?

Thank you All,

Accepted answer +13 upvotes

  1. Select your range from cell A (or the whole columns by first selecting column A). Make sure that the ‘lighter coloured’ cell is A1 the go to conditional formatting, new rule:

    enter image description here

  2. Put the following formula and the choice of your formatting:

    =$A1<>$B1
    

    enter image description here

  3. Then press OK and that should do it.

    enter image description here

Top excel Q&A (6)

+13 upvotes ranks this answer #54 out of 167 excel solutions on this site .