Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the color of cells in one column when they don't match cells in another column

I want to check if the values in one column are the same as values in another column. Whenever the values are not the same, I would like to 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 this?

like image 365
user3381987 Avatar asked Mar 05 '14 05:03

user3381987


People also ask

How do you highlight a cell if it doesn't match another cell?

Highlight When Cells Do Not Equal Cell G6 is the comparison value. It needs to be locked as an absolute cell reference. You can do this by adding $ signs to row and column indicators, or by pressing F4 on the keyboard.


3 Answers

  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 then go to conditional formatting, new rule:

    enter image description here

  2. Put the following formula and the choice of your formatting (notice that the 'lighter coloured' cell comes into play here, because it is being used in the formula):

    =$A1<>$B1
    

    enter image description here

  3. Then press OK and that should do it.

    enter image description here

like image 137
Jerry Avatar answered Oct 11 '22 20:10

Jerry


you could try this:

I have these two columns (column "A" and column "B"). I want to color them when the values between cells in the same row mismatch.

Follow these steps:

  1. Select the elements in column "A" (excluding A1);

  2. Click on "Conditional formatting -> New Rule -> Use a formula to determine which cells to format";

  3. Insert the following formula: =IF(A2<>B2;1;0);

  4. Select the format options and click "OK";

  5. Select the elements in column "B" (excluding B1) and repeat the steps from 2 to 4.

like image 5
Federico Avatar answered Oct 11 '22 21:10

Federico


In my case I had to compare column E and I.

I used conditional formatting with new rule. Formula was "=IF($E1<>$I1,1,0)" for highlights in orange and "=IF($E1=$I1,1,0)" to highlight in green.

Next problem is how many columns you want to highlight. If you open Conditional Formatting Rules Manager you can edit for each rule domain of applicability: Check "Applies to"

In my case I used "=$E:$E,$I:$I" for both rules so I highlight only two columns for differences - column I and column E.

like image 4
aprodan Avatar answered Oct 11 '22 21:10

aprodan