+ Reply to Thread
Results 1 to 5 of 5

Compare columns in excel

  1. #1
    Forum Contributor
    Join Date
    02-03-2009
    Location
    Doha, Qatar
    MS-Off Ver
    Excel 2010
    Posts
    132

    Compare columns in excel

    have attached a sheet all i want is to have the column b in the sheet
    with values that are not common in column a and column c

    in other words if "audit_payment" appears in both colA and colC it should not come in Colb

    pls help
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Compare columns in excel

    You could use this formula to put in cells B1:Bn:
    =IF(ISNA(MATCH(A1,C:C,0)),A1,"")
    Regards,
    Antonio

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Compare columns in excel

    Hello maximpinto,

    The attached workbook has a button on Sheet1 to run the macro. The macro will compare the columns "A" and "C". Only values unique to each are list in column "B". The starting row is row 3. If you have a large data set, this is the fastest method. You won't lose time copying formulas and the execution is very fast.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Contributor
    Join Date
    02-03-2009
    Location
    Doha, Qatar
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Compare columns in excel

    Thanks Leith for the code, it worked fine

    One more questions if i want to select the common ones in comparing both ColA and ColB and put them in Col D. Is it a small change in the code or a big one. If it takes time its ok no isssue
    but let me know so that i can close this post as solved
    thanks
    max

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Compare columns in excel

    Hello Max,

    I modified the macro to list both uniques and duplicates. Here is the new macro code. This has been added to the attached workbook.
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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