Solved

Find duplicate values in column A based on values in Column C

Posted on 2013-06-10
15
371 Views
Last Modified: 2013-06-10
I have an Excel workbook that I need to see if the vlaues in Column A  are duplicates of values in COlumn C.  That is, if A15 is also in Column C, make A15 red with pink text.  I know this would be an array formula in Excel 2010, but not sure how.

Sandra
0
Comment
Question by:ssmith94015
  • 8
  • 7
15 Comments
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 39236186
Conditional formatting can be used to highlight all rows which contain duplicate values in one or more columns. Four scenarios are presented below with solutions. All scenarios require that all cells in the table be selected. In Excel 2003 and earlier, choose the menu command Format->Conditional Formatting and select the "Formula Is" option. In Excel 2007 and later, navigate to the Home tab, select Conditional Formatting->New Rule, and select the Rule Type "Use a formula to determine which cells to format". The following examples assumes the data starts in row 2 and extends to a maximum of row 100.

   =COUNTIF($C$2:$C$100,$A2)>0

Kevin
0
 

Author Comment

by:ssmith94015
ID: 39236190
I don't get it.  I want coulmn A to change its format color if its value is in column B, why would I use column C?
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 39236207
Because you said "Find duplicate values in column A based on values in Column C"

:-)

Use this formula for column B:


   =COUNTIF($B$2:$B$100,$A2)>0

Kevin
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:ssmith94015
ID: 39236209
I did, BUT instead of comparing to unique values, it simply color anything number that matched.  That is, if I have 51 in the first column, but 5 or 182 in the second, it colors the 51 red!  It is not matching to the values in the second column, it is matching to ANY value in the second column.
0
 

Author Comment

by:ssmith94015
ID: 39236211
Sorry, my typo mistake on the columns.
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 39236215
Can you post an example if it's still not working?

Kevin
0
 

Author Comment

by:ssmith94015
ID: 39236216
51      5
215      2
2182      6
182      182
215      215

Simple example, but it highlights the 51, 2182 and 182 in red in teh first column.  Which, what I want, would be the 182 and 215 in the first column to be highlighted.  could it be backward?

Sandra
0
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 39236222
Yes, check the conditional formatting rule. The Rule Type must be "Use a formula to determine which cells to format" and the formula:

=COUNTIF($B$2:$B$100,$A2)>0

Kevin
0
 

Author Comment

by:ssmith94015
ID: 39236226
Yes, used that Rule Tpe, but still does not format the cells correctly.
0
 

Author Closing Comment

by:ssmith94015
ID: 39236228
thank you, got it to work!
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 39236230
See attached.

Kevin
Conditional-Formatting.xlsx
0
 

Author Comment

by:ssmith94015
ID: 39236237
One thing, it only works on small numbers, when I used our 9 digit account numbers, it does not format.  Oh, well, it does work, up to a point.
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 39236244
It will work with nine digit numbers. But the values in column A have to be formatted the same as those in column B.

Kevin
0
 

Author Comment

by:ssmith94015
ID: 39236249
Nope.  Both are formatting the same, but it still only works with small numbers.  I am going to try to create a function that will do this.  So, am posting another question regarding building a function.

Thank you for your help.

Sandra
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 39236252
I just tried with nine digit numbers formatted as numbers, text, and with a leading apostrophe. All worked.

Kevin
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question