Find duplicates in column referencing a 2nd column

siggyr1

New Member
Joined
Mar 2, 2011
Messages
6
Hi

I'm trying to highlight duplicated numerical data in column P using Conditional Formatting =COUNTIF(P:P,P2)>1.

However, I only want the duplicate data to be highlighted if the data in the next column Q = "expired". (same row)

I'm trying derivatives of ==COUNTIF(P:P,P3)>1,and(Q3="current"), not having much success.

Any thoughts anyone?

Many thanks
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Welcome to the MrExcel board!

There are a couple of ways to interpret what you have asked. To clarify, would P2 be formatted in this example since Q2 is "expired" and P2 is duplicated? Or would Q4 also need to be "expired" and then P2 and P4 would be formatted?

Also, what version of Excel are you using?

Excel Workbook
PQ
1
21expired
32
41
5
CF
 
Upvote 0
Hi

All fields in Q would have an entry of either "Current" or "Expired".
My CF should only show those entries in P where the corresponding Q in the same row is "Expired"

Using 2007 SP2

Thank you.
 
Upvote 0
=AND(COUNTIF(P:P,P3)>1,Q3="expired")
 
Upvote 0
Hi

All fields in Q would have an entry of either "Current" or "Expired".
My CF should only show those entries in P where the corresponding Q in the same row is "Expired"

Using 2007 SP2

Thank you.
That still doesn't clarify which column(s) have to be duplicated. So basically same question as before:

Would P2 be formatted in this example since Q2 is "expired" and P2 is duplicated? Or would Q4 also need to be "expired" and then P2 and P4 would be formatted?

Excel Workbook
PQ
1
21expired
32expired
41current
5
CF
 
Upvote 0
Sorry, I see the question now.

I'm only interested to see where P column has duplicate data in it, where same row Q = "expired".
i.e. P2 and P4 are the same, and Q2 & Q4 = "expired"

I'm not concerned if P2 is duplicated with P4, but Q2 = "current" and Q4 = "expired" .

Hope that makes sense..??

:)
 
Upvote 0
Select P2:Pxx and apply the Conditional Formatting shown. You may need to adjust the $100 in the formula if your data goes beyond row 100 or if it is significantly less than 100.

Excel Workbook
PQ
1
21expired
32expired
41current
51expired
63expired
73expired
8
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
P21. / Formula is =AND(Q2="expired",COUNTIFS($P$2:$P$100,P2,$Q$2:$Q$100,"expired")>1)Abc
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,334
Members
452,907
Latest member
Roland Deschain

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