+ Reply to Thread
Results 1 to 5 of 5

comparing two lists for matches

  1. #1
    Forum Contributor
    Join Date
    01-13-2006
    Location
    Texas
    Posts
    161

    comparing two lists for matches

    Hello all,

    I am trying to compare a large list of email addresses against a smaller list of addresses. My purpose is to write out a third list containing the entries from the larger list that do NOT have a match in the smaller list. The two lists are in adjacent columns on the same worksheet and I want the third list to be in another column. I would like to avoid blank cells in the third list, so it will be shorter than the Master and will not align row by row. The two original lists are designated with named ranges "MasterList" and "DropList".

    If I have done it correctly, a .doc word file is attached with a copy of my attempt so far.

    Thanks in advance for any help.

    Conor
    Attached Files Attached Files

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You don't really need VBA to do that.... you can use a formula.

    Say your large list is in A2:A10 and your small list is in B2:B5.....then use this formula to retrieve items in column A that don't appear in column B....

    Please Login or Register  to view this content.
    For the formula to work properly, you have to confirm it with CTRL+SHIFT+ENTER not just ENTER....you will see { } brackets appear around the formula.... then you can copy down as far as you desire.

    IF you adjust ranges in the formula, you will have to reconfirm with CSE keys before copying down again.
    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 Contributor
    Join Date
    01-13-2006
    Location
    Texas
    Posts
    161

    your reply re: matching lists

    Thanks for the reply. That formula works for the first cell, c2, but not for any cell below it. I can use your approach if you can supply a tweak. Every cell below c2 shows #NUM. Thanks.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    As per my note.. you need to confirm the formula with the CTRL+SHIFT+ENTER keys. This will force { } brackets around the formula making it a special array formula.... then you can copy it down...

  5. #5
    Forum Contributor
    Join Date
    01-13-2006
    Location
    Texas
    Posts
    161

    minor point of clarification

    Thanks. This works very nicely. For any other readers, my confusion arose because I copied and pasted the formula from your reply. That part is fine, but a user needs to edit the formula (just click in it somewhere) on the formula in order to apply the array characteristics with ctrl+shift+enter. Then it can be copied. Thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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