Solved

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

Posted on 2013-06-10
15
369 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
 

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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now