Ask Experts Questions for FREE Help !
Ask
    RayGary274's Avatar
    RayGary274 Posts: 1, Reputation: 1
    New Member
     
    #1

    Mar 31, 2009, 11:15 AM
    Trying to extract unique values from 2 spreadsheets
    Hello, I have 2 lists of names/addresses. I have a master list of about 35,000(list1) and another list of about 16,000(list2) that was compiled from names of list1. All I am trying to do is subtract list2 from list1 so that I end up with the 19,000 names that are unique to list1 but not on list 2(list1-list2). I've tried different "advanced filter" methods but can't seem to get it right.
    stingRay18's Avatar
    stingRay18 Posts: 19, Reputation: 2
    New Member
     
    #2

    Mar 31, 2009, 01:55 PM
    Quote Originally Posted by RayGary274 View Post
    Hello, I have 2 lists of names/addresses. I have a master list of about 35,000(list1) and another list of about 16,000(list2) that was compiled from names of list1. All I am trying to do is subtract list2 from list1 so that I end up with the 19,000 names that are unique to list1 but not on list 2(list1-list2). I've tried different "advanced filter" methods but can't seem to get it right.
    Back up your lists then add a column to each list and compare them using the Match function =MATCH(G2,A$2:A$24,0)

    Then you can use this information to merge them as required.

    It may not be as elegant as you hoped but it might do the job.

    Be well
    JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #3

    Mar 31, 2009, 10:24 PM

    Put the long list in column A, the short list in column B, then run this macro to get the new names in column C. It is expected that there are titles in A1 an B1 so the first name to check is in row 2.
    Code:
    Option Explicit
    Sub ListNewItemsInColumnC()
    'Compare long list in A to short list in B, list new items in C
    Dim lastrowA As Long
    Application.ScreenUpdating = False
    
    lastrowA = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
    
    Columns(3).ClearContents
    Range("C1").Value = "New Names"
    
    Range("C2:C" & lastrowA).FormulaR1C1 = "=IF(COUNTIF(C[-1],RC[-2])=0,RC[-2],"""")"
    Range("C2:C" & lastrowA).Value = Range("C2:C" & lastrowA).Value
    Range("C2:C" & lastrowA).SpecialCells(xlCellTypeBlanks).Delete (xlShiftUp)
    
    Application.ScreenUpdating = True
    End Sub

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Copying spreadsheets onto a floppy [ 5 Answers ]

Hi, I'm trying to copy some excel spreadsheets onto a floppy disk. It keeps telling me to format the disk even though the disks I bought are formatted already. I go into the file I want and hit copy and it just comes up with must format disk, so I try that and then it comes up disk cannot be...

Filter from 2 Columns (Unique values) in Excel [ 1 Answers ]

I need to filter from both these sets of data in excel Set 1 Set 2 ----------------------- 986 Buchanan Dodsworth 563 67 789 Buchanan 235 689 Dodsworth 789 143

How to find unique values in an entire column [ 10 Answers ]

hi all please tell me how can I findout the unique values in an entire coloumn. for example I have 3 coloumn in an sheet. Name Prod. Value a 24 100 b 26 240 a 33 120 a 21 200


View more questions Search