Compare rows based on 3 columns and highlight when column1=column2, but column 3 is different

JohannaL

New Member
Joined
Sep 16, 2015
Messages
2
I need your excel help! – if I have three columns, I want to highlight the rows where the values in column 1 and 2 match, but are different in column 3. For instance:

A1xx
A1xx
A2xa
A2da
B3zz
B3zz
B3zy

<colgroup><col width="56" span="3" style="width:42pt"> </colgroup><tbody>
</tbody>

Here row 1 and 2 match in column 1 and 2, and also column 3 – everything ok
Row 3 and 4 also match in column 1 and 2, but column 3 does not – highlight
Row 4,5,6 - match in column 1 and 2, but column 3 is not the same for all 3 - highlight

If column 1&2 do not match, column 3 is irrelevant and no highlighting is necessary.

Do you know how to do this? That would safe me A LOT of pain and manual labor :)
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Assuming your columns are A, B, and C (if not, change them in the formula), select column A. Then click on Conditional Formatting --> new rule --> Use a formula to determine which cells to format.
In the formula box, type:
=(A1=OFFSET(A1,-1,0))*(B1=OFFSET(B1,-1,0))*(C1<>OFFSET(C1,-1,0))
Then click Format... and select a highlight color.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,503
Messages
6,125,179
Members
449,212
Latest member
kenmaldonado

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top