Conditional Format Duplicate in Two columns

borolo222

New Member
Joined
Aug 18, 2009
Messages
42
hi, I've been giving thought to this but I can't get to a solution. I need a conditional format that changes color of duplicates. I use this formula with one column,

=COUNTIF(A:A;A1)>1

but I need to give it one condition more, I need it to take into account the values in column B and change the color of cells in column A only to the ones that share the same values in A and in B. Example

Column A - Column B
1 - pp
2 - xx
3 - yy
2 - xx
2 - zz
2 - zz

In this case I only need highlighted the cells with 2 - xx (only if they are repeated)

Another thing to consider, The value in B is static, which means only the cells with XX in B that have the same values en A must be highlighted, that's why 2 -zz is repeated but not highlighted. haha Hope I was clear enough.

Thanks for your help.
 
Last edited:

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi,

I guess you haven't had a reply because it is unclear as to what is in column A & B by the sample data you have posted.

Is this what you have?....


Excel Workbook
ABCD
1Data AData B*CF Formula
21PP*FALSE
32XX*TRUE
43YY*FALSE
52XX*TRUE
62ZZ*TRUE
72ZZ*TRUE
Sheet3


If you can post some accurate sample data, a clear explanation of what you require and the expected results, I'm sure that you will get a solution.

Ak
 
Upvote 0
Hi
Try in CF
=COUNTIF(B:B,A2)>0
you want to change the cell colour in column A if same value found in column B
 
Upvote 0
Thanks akashwani for your tip with the table. I'll use it from now on.

Maheshp, I tried your formula with no luck.

I want to highlight cells in column A that meet the following conditions:
1. Value is repeated
2. Value in column B is "XX" on the same row when condition 1 is met.

In the example below only cells A3 and A5 should be highlighted.

Thanks again,


Hi,

I guess you haven't had a reply because it is unclear as to what is in column A & B by the sample data you have posted.

Is this what you have?....


Excel Workbook
ABCD
1Data AData B*CF Formula
21PP*FALSE
32XX*TRUE
43YY*FALSE
52XX*TRUE
62ZZ*TRUE
72ZZ*TRUE
Sheet3


If you can post some accurate sample data, a clear explanation of what you require and the expected results, I'm sure that you will get a solution.

Ak
 
Upvote 0
Hi,

How do you get the repeated value in A?

Try this for your CF...

=AND(A2>1,B2="XX")

Ak
 
Upvote 0
Hi,

How do you get the repeated value in A?

Try this for your CF...

=AND(A2>1,B2="XX")

Ak

the value in A2 is an input from the user. the data in column A is the name of a project and the data in column B is the state of the project. Each project has different instances but can't have the same state. So when the user inserts the name of a project that is already on the list, the color of the cell gets highlighted if he puts a state that is already in for that project.
 
Upvote 0
Hey guys, I got it:

=AND(COUNTIFS($A:$A,$A1,$B:$B,"=XX")>1,$B1="XX")

First I count for each row if condition 1 and condition 2 are met, and then I check again if that row has the state that I want to compare to.
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,853
Members
452,948
Latest member
UsmanAli786

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