+ Reply to Thread
Results 1 to 12 of 12

Advanced Filter

  1. #1
    Forum Contributor
    Join Date
    08-04-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    143

    Advanced Filter

    Hi all,

    I would like to know whether is there any way to compare data from 2 different sheets using advanced filters. sheet1 consists of mastercopy data while sheet2 consists of some data populated from sheet1.

    my aim:
    compare sheet1 and sheet2, then copy the unique values into sheet3
    (so data in sheet2+ data in sheet3 = data in sheet 1).

    i have tried using looping to compare, and it took ages( i stopped the macro halfway after 10mins because it took too long) to go through 10k rows of data in sheet1.

    i have also tried copying both sheet1 and sheet2 into sheet3, then delete those rows that are repeated. it takes 2-5mins to go through 10k rows of data in sheet1, and i am expecting around 60k rows of data to compare.

    currently i am trying to use advanced filter to come out with a faster solution.however, the problem i am facing now is that advanced filter seems to be able to work only for 1 region of data in 1 sheet.

    does any1 have any idea or better solution?
    i am open to any suggestions.

    thanks

  2. #2
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483

    Re: advanced filters

    Best option i think is to used excel's import external data function which allows you to run sql queries based on your data.

    Please find attached an example.

    Note: Best to save to desktop and re-configure the sql query to read from your desktop path. At first, it will try and run from mine.
    Attached Files Attached Files
    --
    Regards
    PD

    ----- Don't Forget -----

    1. Use code tags. Place "[code]" before the first line of code and "[/code"]" after the last line of code. Exclude quotation marks

    2. Thank those who have helped you by Clicking the scales above each post.

    3. Please mark your post [SOLVED] if it has been answered satisfactorily.

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: advanced filters

    Sounds to me like you need to add a column to your data on sheet 1 that uses countif to check if the value is on sheet 2. Then use this column to filter for records not on sheet 2 and copy uniques to sheet 3.
    Remember what the dormouse said
    Feed your head

  4. #4
    Forum Contributor
    Join Date
    08-04-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    143

    Re: advanced filters

    i have attached an example of my project.it compares column a,b,c of sheet "raw_data" and "manual selection" and then copy the unique data into "hidden". please take a look and give some advice for improving the project. thanks

    ps: it is uncompleted and has plenty of room for improvements.

    @pr4t3ek : thanks. i shall try it out and let you know later.

    @romperstomper : i have 3 columns of data to check.currently, my macro checks the value of individual cells in the region for duplicates. i am wondering if there is any possible ways to check the data row by row instead of cell by cell.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    08-04-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    143

    Re: advanced filters

    any advice?

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Advanced Filter

    I thought you were getting back to us re the first suggestion?

    See attached for advanced filter version - just need to copy and paste to target sheet.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    08-04-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    143

    Re: Advanced Filter

    oh my god....i am so sorry about that. i had to do something else right after i replied in the thread. i had totally forgotten about the file contributed by pr4t3ek. i promise i will go through both files the moment i reach office tomorrow morning. once again, i am terribly sorry for forgetting about the file and thanks for the help from both of you

  8. #8
    Forum Contributor
    Join Date
    08-04-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    143

    Re: Advanced Filter

    @pr4t3ek : i am sorry that i do not understand how your attached file work.what is "sql queries"?

    @romperstomper: the column a in sheet"raw_data" always shows true no matter if there is any duplicates in sheet"manual selection". but thanks. i have gotten an inspiration and trying out the "countif" function for my macros.

  9. #9
    Forum Contributor
    Join Date
    08-04-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    143

    Re: Advanced Filter

    is there any help?

  10. #10
    Forum Contributor pr4t3ek's Avatar
    Join Date
    10-13-2008
    Location
    Melbourne, Australia
    MS-Off Ver
    2003 & 2007, 2010
    Posts
    483

    Re: Advanced Filter

    Hello,

    if you aren't familiar with SQL then my method will not work.

    To give you an example: Enter values into 'Rate Plan' and 'Zones'. Then to go results page and click on cell A1. Then go to Data and then refresh Data.
    (Note: This is Excel 2003 speak, menu items are different in Excel 2007).

    I hope this helps but if you aren't familiar with SQL then I wouldn't even bother with my method.....

  11. #11
    Forum Contributor
    Join Date
    08-04-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    143

    Re: Advanced Filter

    alright. thank you for your effort and time spent

  12. #12
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Advanced Filter

    Did you fill on the new Key column on the second sheet while testing?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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