+ Reply to Thread
Results 1 to 12 of 12

Finding duplicates in two seperate columns

  1. #1
    Registered User
    Join Date
    07-12-2007
    Posts
    40

    Finding duplicates in two seperate columns

    This should be an easy one, it has slipped my mind.

    I have columns A and B, I want to find any names that appear in both column A and column B. I want them to show in a certain color.

    Any ideas?
    Last edited by oldchippy; 10-23-2008 at 04:22 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Select column A and invoke Conditional Formatting from the Format menu..

    Choose Formula Is from 1st drop down and enter formula: =Match(A1,B:B,0)

    Click Format and choose highlight colour.

    Click Ok, Click Ok to finish.

    Select column B and repeat above substituting formula with =Match(B1,A:A,0)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Take a look here

    http://spreadsheetpage.com/index.php...al_formatting/
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  4. #4
    Registered User
    Join Date
    07-12-2007
    Posts
    40
    What is this formula telling Excel to do exactly?

    Is it saying find names in column A that appear in column B, and vice versa?

    I have a two different columns. One full of managers, and one full of representatives. I'm trying to make sure that there is not a situation where they are approving for each other

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    The first formula is checking if each individual cell in Column A is repeated at all in column B...

    The second is checking if each individual cell in column B is repeated at all in column A.

    So if there is a duplication in both columns, both those duplicates would be highlighted.

  6. #6
    Registered User
    Join Date
    07-12-2007
    Posts
    40
    Oh okay, I see, so my next question is a result of the formula.

    It seems that in column B, after some of the names there are spaces. Because of the spaces, Excel isn't recognizing some of the data to be the same.

    Is there something I can do about the spaces?

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    In an adjacent column enter formula: =Trim(B2) where B2 is first cell after headings....

    copy the formula down the column...

    Then copy this new column, go to B1 and go to Edit|Paste Special and select Values...

    Now you can delete that new column..

    You can do the same for Column A if needed.

  8. #8
    Registered User
    Join Date
    07-12-2007
    Posts
    40
    Wow! I didn't know you could do that. That's awesome.

    The last and final question, promise! Is there a way I can have Excel look to see if any cells are flip flopped?

    For example, highlight cells that have in cell A32 "Bob Saget" and in B32 "John Stamos" and then further down the list there is A64 "John Stamos" and in B64 "Bob Saget"?

    Is this possible? I think I am getting too picky, but this would be awesome! Thanks for showing me how to trim that data down, amazing...

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Select the entire range from A1:B whatever..... try not to select whole column as the formula may slow things down....

    Then invoke CF again... If you already have a conditional format, click Add to add another...

    Enter formula: =AND(A1<>"",ISNUMBER(MATCH($A1&$B1,$A$1:$A$10&$B$1:$F$10,0)))

    adjust the ranges to suit your data....

    Click Format and add your colour scheme...

    Note: The first formula in CF will take precedence...

  10. #10
    Registered User
    Join Date
    07-12-2007
    Posts
    40
    It seemed to have highlighted everything in the range I selected...

    =AND(A1<>"",ISNUMBER(MATCH($A1&$B1,$A$1:$A$65&$B$1:$B$65,0)))

    Did I type everything right?

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Sorry.. bad formula...should've tested it more...

    try this instead:

    =AND(A1<>"",SUMPRODUCT(--($A$1:$A$65&$B$1:$B$65=$B1&$A1)))

  12. #12
    Registered User
    Join Date
    07-12-2007
    Posts
    40
    Thank you so much for being so patient with me on this! It worked out great! Thanks again for everything!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Merge Columns B,C,D,E and F, If duplicates exist in Column A
    By julia81 in forum Excel Programming / VBA / Macros
    Replies: 84
    Last Post: 03-25-2014, 03:37 PM
  2. Generate two new columns from one (no duplicates)
    By wali in forum Excel Programming / VBA / Macros
    Replies: 37
    Last Post: 07-23-2008, 08:57 AM
  3. Finding rows with duplicates in two columns
    By James McMurray in forum Excel General
    Replies: 3
    Last Post: 07-18-2008, 07:03 PM
  4. Replies: 3
    Last Post: 03-02-2007, 07:13 AM
  5. finding duplicates between 2 columns
    By jacobjmorris in forum Excel General
    Replies: 2
    Last Post: 11-21-2006, 11:09 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1