Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: compare column a to b and b to a

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member ayazgreat's Avatar
    Join Date
    Mar 2012
    Posts
    86
    Rep Power
    14

    compare column a to b and b to a

    Hi
    I have 800,000 rows data in column a and near about same data in column b, actually I was using vlookup formula to comprare both columns data but it hangs workbook and does not work.
    I want a macro to find colomn b value in col a ad copy those values are not found in column a i mean unique values from.col b which are not matched in col a.
    And same procedure for column a values to find in col b and copy those values are not found in col b.




    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Last edited by DocAElstein; 06-10-2023 at 04:18 PM.

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Ayaz, are you sure all of these records are unique if we were to look at both the columns together, or will there be duplicates at that level too?
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  3. #3
    Member ayazgreat's Avatar
    Join Date
    Mar 2012
    Posts
    86
    Rep Power
    14
    There are duplicated values also , most of records are duplicated but I want to compare both columns to see that which records are unique if these are in col a or b

  4. #4
    Member ayazgreat's Avatar
    Join Date
    Mar 2012
    Posts
    86
    Rep Power
    14
    An example a column has values 1,3,4,6,9,11,12 and b column has values 1,2,3,7,9,10,13
    When compare col b from col a so result is 2,7,10,13
    When compare col a to col b so result is 4,6,11,12

  5. #5
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    14
    Quote Originally Posted by ayazgreat View Post
    An example a column has values 1,3,4,6,9,11,12 and b column has values 1,2,3,7,9,10,13
    When compare col b from col a so result is 2,7,10,13
    When compare col a to col b so result is 4,6,11,12
    Are these examples of real values you have? If so, what is the maximum value that can appear in a column? Depending on your two answers to these questions, there may be a relatively simple code solution. However, if those are values that you actually have, could you post an example with the real values? Again, depending on what they are, there again, may be a relatively simple code solution.

  6. #6
    Member ayazgreat's Avatar
    Join Date
    Mar 2012
    Posts
    86
    Rep Power
    14
    Yes these are values , real.example like
    Col a
    814090
    814091
    814092
    818000
    818001
    818002
    818003
    910010
    987012

    Col b
    814090
    814092
    814093
    814095
    818003
    818004
    818005
    818009
    818010
    818011
    910010
    910011
    910012
    987761

    The data of both columns are in 800,000 rows of each

  7. #7
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    14
    Quote Originally Posted by ayazgreat View Post
    Yes these are values , real.example like
    Col a
    814090
    814091
    ..........

    Col b
    814090
    814092
    ..........

    The data of both columns are in 800,000 rows of each
    What is the minimum and maximum possible values in each column?

  8. #8
    Member ayazgreat's Avatar
    Join Date
    Mar 2012
    Posts
    86
    Rep Power
    14
    Minimum 400,000 to 500,000 and maximum 10,00,000

  9. #9
    Member ayazgreat's Avatar
    Join Date
    Mar 2012
    Posts
    86
    Rep Power
    14
    Could it be possible to be done through code

  10. #10
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi

    Could you please upload a sample workbook with expected result ?
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

Similar Threads

  1. Replies: 10
    Last Post: 05-23-2013, 12:30 PM
  2. Converting a Column Number to a Column Letter
    By Rasm in forum Excel and VBA Tips and Tricks
    Replies: 6
    Last Post: 12-17-2012, 02:29 AM
  3. Replies: 3
    Last Post: 08-05-2012, 09:16 PM
  4. Replies: 1
    Last Post: 11-11-2011, 02:06 PM
  5. Compare two worksheets and List Differences
    By excel_learner in forum Excel Help
    Replies: 1
    Last Post: 11-02-2011, 10:03 PM

Posting Permissions

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