+ Reply to Thread
Results 1 to 6 of 6

Finding Unique Between 2 Columns

  1. #1
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Finding Unique Between 2 Columns

    Hello,
    I would like to ask if there's a formula or perhaps a Macro that can find which are the correct values on 2 columns.
    I have list of Data on Column B and Column C. I'd like to do a compare and list out the Unique value on column D.
    Can this be achieved? By Macro or Formula?
    I have attached the spreadsheet. Please help.

    Thank you in advance.
    Andrew
    Attached Files Attached Files
    Last edited by Andrew.Trevayne; 09-06-2011 at 10:37 AM.

  2. #2
    Registered User
    Join Date
    04-18-2011
    Location
    Surrey, UK
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Finding Unique Between 2 Columns

    Hi Andrew,

    I would try doing this using macros because I dont know how to do it using formulas. To do this:

    1) Make sure that your spreadsheet is formatted exactly as per the version you have uploaded (e.g. the sheet with your data in is called "Sheet1", the data to be checked is in columns B and C, and the data starts on row 4.

    2) Go to Tools ---> Macro ---> Visual Basic Editor.

    3) Insert a new module (Insert ---> Module)

    4) Paste the following code into the module:

    Please Login or Register  to view this content.
    5) Might be worth saving your workbook here.

    6) Go to tools --> Macro ----> Macros....

    There should be a macro called process data. Run it and it should work ok. I havent checked it though so dont sue me if it doesnt give a perfect result!

    Good luck and kind regards,

    Paul

  3. #3
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Finding Unique Between 2 Columns

    Hi Paul,
    Thank you very much for taking time looking at this. I think your Macro works great!
    Is it also possible to modify this macro to do a compare?
    Maybe Column B will be my Reference and Column C will be my New Data. On Column D I will get a return wherein it will do a compare between the 2 columns, rather than Unique, it will only list Data that Column B has that Column C do not have. Is this possible?

    Once again many thanks for your help.

    regards,
    Andrew

  4. #4
    Registered User
    Join Date
    04-18-2011
    Location
    Surrey, UK
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: Finding Unique Between 2 Columns

    Hi again,

    To do what youre saying I think the following code will work;

    Please Login or Register  to view this content.
    Essentially you build a "dictionary" (a list, basically) of all the unique items that are in column C. You then switch back to column B and run down it, checking the dictionary for each entry. If its in the dictionary, then you skip it because it exists in column C, if its not, then you write it into column D.

    Where in the Phillipines are you btw? I was in Manila recently staying in a southern area of the city - thought it was really great. The Phillipino people are the friendliest people in the world!

    Good luck with the spreadsheet.

    P

  5. #5
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Finding Unique Between 2 Columns

    Hi Paul,
    I am from Manila. I hope you enjoyed your stay there ^^
    Anyways many many thanks for taking time doing this, I know its not an easy request.
    I will work on it and once again, thank you.

    Andrew

  6. #6
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Finding Unique Between 2 Columns

    Hi Paul,
    Just tested it and works perfect. Thank you ^^

+ 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