+ Reply to Thread
Results 1 to 11 of 11

Coimpare A to B and B to A - results in separate columns

  1. #1
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Coimpare A to B and B to A - results in separate columns

    I have searched through many threads but can't seem to find one that closely matches what I want to accomplish. Each day I will be comparing a different set of values in Column A and Column B (the number of rows will vary from day to day). I want to identify the values that exist in Column A but not Column B and to identify the values in Column B that do not exist in Column A. I have attached a sample spreadsheet showing a couple of different ways the results could show (Columns C & D or Columns E & F). Could someone look at this and see if there is a way to get the results I want?

    Thanks SO much!
    Attached Files Attached Files

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Coimpare A to B and B to A - results in separate columns

    I don't completely understand your example. 78943 is the first number you show as not being in Column B. It IS in column B just not in the same row.

    Are you trying to find numbers that don't exist at all, or numbers that don't match the corresponding row in Column A?

    If you're searching for numbers that aren't in both columns in the same row why isn't 79164 and 79217 found?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Coimpare A to B and B to A - results in separate columns

    Select column A and give it a name of FindA. Name column B FindB. Then in C2, put the following formula and drag it down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In D2, put:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The "missing" results will be scattered through the rows, rather that grouped at the top like your example, but you could sort by C and D to get them to the top. Good luck!

  4. #4
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Coimpare A to B and B to A - results in separate columns

    The data is captured from two different sources and if users followed the correct process, Column A should match Column B. So to answer your question, Col A 78943 already has a match in Column B, leaving the 2nd Col A 78943 without a match... It may not be on the same row depending on how the data was extracted and sorted. Does that answer your question?

  5. #5
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Coimpare A to B and B to A - results in separate columns

    Let me know if you are looking for this.....

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  6. #6
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Coimpare A to B and B to A - results in separate columns

    This is really close. There could be multiples of the same number in Column A or Column B (look at Column A value 78943 for instance). 78943 exists twice in Column A, but only once in Column B. So 78943 should show as a missing number when comparing A to B. The same would apply when comparing B to A. 80227 exists 3 times in Column B, but only twice in Column A, so 80227 should show as missing. This logic makes it more complicated and that's where I'm getting stuck. I suppose it could go through the comparison and delete out matches as it finds them and you would end up with Col A having 78943, 79274, 79552 and 79960 and Col B would have 80227... Does that make sense?

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Coimpare A to B and B to A - results in separate columns

    I think this is what you want. Take a look at the below code....

    Please Login or Register  to view this content.

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Coimpare A to B and B to A - results in separate columns

    Please ignore this duplicate post.

  9. #9
    Registered User
    Join Date
    10-08-2013
    Location
    Eugene, OR
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Coimpare A to B and B to A - results in separate columns

    This is exactly what I was looking for. Thank you so much. I will marked this as solved and I can't begin to tell you how impressed my users will be!

  10. #10
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Coimpare A to B and B to A - results in separate columns

    You're welcome. Glad to help you. Thanks for the feedback and rep.

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Coimpare A to B and B to A - results in separate columns

    Hi Ellen,

    Here's another solution:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

+ 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. [SOLVED] Separate numeric/text combination into two separate columns.
    By Jim15 in forum Excel General
    Replies: 6
    Last Post: 10-09-2013, 05:49 PM
  2. [SOLVED] Extract and separate the letters into their own separate columns
    By siroos12 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-22-2013, 10:18 AM
  3. Place results in separate columns when exporting to csv
    By concatch in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2011, 04:32 AM
  4. How to Separate Chunks of Characters and put them in separate Columns
    By crisshinn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-08-2011, 10:16 AM
  5. I wish to separate city, state, and zip into 3 separate columns
    By Bob Woolbert in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-11-2006, 01:45 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