+ Reply to Thread
Results 1 to 6 of 6

Compare two columns and produce a list of 'missing' items

  1. #1
    Registered User
    Join Date
    04-27-2007
    Location
    Lancaster UK
    Posts
    37

    Compare two columns and produce a list of 'missing' items

    My question is how to compare two customer id columns in separate books, and get a list of all customer id's that are missing from the second book.

    I will be very grateful if someone can help again.

    Regards,

    Steve Quinn
    Woods of Morecambe Limited
    www.woods-online.co.uk

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Compare two columns and produce a list of 'missing' items

    It would be very helpful if you posted the structure of the CustID.
    Samples of the CustID data would also help.

    Are they all numeric? Alphanumeric?
    Do they contain dashes (-) or slashes (/)?
    Are they duplicated in the list or are they all unique?
    Are there column headings for the separate lists?
    Are there any blank rows in the lists?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    04-27-2007
    Location
    Lancaster UK
    Posts
    37

    example files

    Hi Ron, thanks for helping.

    I have attached two files for example purposes.

    For my needs, the customer id's are all numbers, no spaces, no funny characters, no duplicates and as you can see the columns have headings.

    Thanks in advance,

    Steve
    Attached Files Attached Files

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Compare two columns and produce a list of 'missing' items

    This isn't the typical formula approach, but this is
    the way I would typically do what you're asking.....
    (It may seem like many steps, but once you see how it works,
    you can set the whole thing up in under a minute)

    • Name the data ranges in each workbook and save the workbooks.
    I called the ranges: rngCustDataBk1 and rngCustDataBk2, respectively.

    • Open Book1

    From the Excel Main Menu:
    <data><get external data><new database query>
    Navigate to Book1
    ...select rngCustDataBk1
    ...Click the [Next] buttons, then [Finish]

    MS Query will be open and you'll see your Book1 data.

    • Click the Add Tables button.
    • Navigate to Book2 and select the rngCustDataBk2 range.
    (it will then display in the MS Query window next to the Book1 data)

    • Drag the Customer ID field from Book1 on top of the Customer ID field from Book2.
    (a JOIN line will then connect those fields)

    • Double-click that line to view the Joins options window
    • Select option 2: All values from rngCustDataBk1 (etc)
    • Click [Add]....Click [Close]

    Almost done....
    If the Criteria section is not visible, click the Show/Hide criteria button
    • Criteria Field: rngCustDataBk2.Customer ID
    • Value: type this--> IS NULL
    • Click the Query Now button (or...<records><query now>

    The end result displays ONLY Book1 Customer ID's with no match in Book2

    If everything looks right, click the Return Data button and
    select where you want the results to display.

    If you're interested in that approach,
    post back if you have more questions.

  5. #5
    Registered User
    Join Date
    04-27-2007
    Location
    Lancaster UK
    Posts
    37

    will try this asap

    Hi Ron, many thanks for taking the time to help.

    I will try this asap.

    Cheers,

    Steve

  6. #6
    Registered User
    Join Date
    04-27-2007
    Location
    Lancaster UK
    Posts
    37

    It Worked!!!

    Hi ron, just a follow up to this post, your solution worked although i had to mess about with the cell formatting and 'numbers stored as text' issues but with a bit of perseverance we got exactly the result we were after which i could not have done alone.

    Once again, many thanks,

    Steve

+ 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. Using four columns to produce another column
    By taufiq in forum Excel General
    Replies: 1
    Last Post: 01-31-2008, 07:39 PM

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