+ Reply to Thread
Results 1 to 13 of 13

comparing the rows in different columns and displaying the results

Hybrid View

gencoglu27 comparing the rows in... 07-18-2013, 08:13 AM
aydeegee Re: comparing the rows in... 07-20-2013, 02:10 AM
gencoglu27 Re: comparing the rows in... 07-20-2013, 04:04 PM
aydeegee Re: comparing the rows in... 07-21-2013, 04:02 AM
gencoglu27 Re: comparing the rows in... 07-21-2013, 09:48 AM
hamjam Re: comparing the rows in... 07-22-2013, 07:26 AM
gencoglu27 Re: comparing the rows in... 07-22-2013, 08:26 AM
hamjam Re: comparing the rows in... 07-22-2013, 12:27 PM
aydeegee Re: comparing the rows in... 07-22-2013, 03:33 PM
gencoglu27 Re: comparing the rows in... 07-22-2013, 06:18 PM
aydeegee Re: comparing the rows in... 07-23-2013, 04:17 AM
aydeegee Re: comparing the rows in... 07-23-2013, 04:16 AM
gencoglu27 Re: comparing the rows in... 07-23-2013, 05:31 AM
  1. #1
    Registered User
    Join Date
    07-10-2007
    Location
    Turkey-Bartın/
    MS-Off Ver
    Ms Office-2007
    Posts
    44

    comparing the rows in different columns and displaying the results

    Hi
    I have two groups of lottery results. The first group has the last year results of 200 rows, and the second group displays this year results of 100 rows. I want to start comparing the first row of the second group (green group) with all the rows of the first group( blue group) giving me a count of how many matches are found.. And do the same search for all the other rows of green group…
    Please have a look at the attachment file.
    Thank you.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-25-2011
    Location
    Eastbourne, England
    MS-Off Ver
    Excel 2010
    Posts
    1,089

    Re: comparing the rows in different columns and displaying the results

    Hi gencoglu27

    I think the attached achieves what you requested.

    When you win the millions using this, please remember who sent it to you

    Let me know if you have any questions

    Regards
    Alastair
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    07-10-2007
    Location
    Turkey-Bartın/
    MS-Off Ver
    Ms Office-2007
    Posts
    44

    Re: comparing the rows in different columns and displaying the results

    Thank you very much indeed,
    I thought that my post was bad one and it would not be answered. But you managed to answer it just as I wish. Your code works nice.the only problem is that it is a little bit too slow . Actually I have more than 10.000 rows and I want it to work faster.. Still I wil play with it..

    Thanks,
    Last edited by gencoglu27; 07-20-2013 at 04:33 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    09-25-2011
    Location
    Eastbourne, England
    MS-Off Ver
    Excel 2010
    Posts
    1,089

    Re: comparing the rows in different columns and displaying the results

    Hi gencoglu27

    Answer - get a faster machine!

    On a more serious note the VBA has been written specifically for 200 lines. Are you OK with how to change it?

    One thing that can be done to speed things up is to turn off screen updating while the VBA is running. The downside of this is that it looks like nothing is happening for however long it takes to run. Again - are you ok with how to make the change, or do you want me to do it?

    Regards
    Alastair

  5. #5
    Registered User
    Join Date
    07-10-2007
    Location
    Turkey-Bartın/
    MS-Off Ver
    Ms Office-2007
    Posts
    44

    Re: comparing the rows in different columns and displaying the results

    Thanks Alastair,
    Actually my Pc is fast enough .For example it can generate 270.000 lines of lottery combination in less than 3 minutes.. Now I attached another file of 1,000 of lines in which I changed my question so it may work faster.( I would like you to omit the columns of 1 match,2 matches and 3 matches) please have a look at it.( but wait I can not manage the attachments as it says it is 1.58MB !!!)...So how can I send my file to you ?
    my computer has AMD athlon2 proccesor 4 core ..4GB Ram..

    Thanks
    Attached Files Attached Files
    Last edited by gencoglu27; 07-22-2013 at 05:46 AM.

  6. #6
    Forum Contributor
    Join Date
    01-07-2013
    Location
    south africa
    MS-Off Ver
    Excel 2003-13
    Posts
    210

    Re: comparing the rows in different columns and displaying the results

    Hello
    I am coming in at the end but took this problem as an exercise and spent the occasional spare hour or 2. So I have not looked at the code that was referred but created my own solution. It should managed a dynamic length of numbers.

    Perhaps give it a try and see if it improves on the performance of the other solution.

    Regards
    Attached Files Attached Files
    Most helpful to mark solved items as such (see help for directions). Star ratings are always welcome.

  7. #7
    Registered User
    Join Date
    07-10-2007
    Location
    Turkey-Bartın/
    MS-Off Ver
    Ms Office-2007
    Posts
    44

    Re: comparing the rows in different columns and displaying the results

    Thanks Hamjam,
    I have just tested your code. It works ok. But when it comes to comparing 10.000 lines to 600 lines ..(which is I am after..), your code is even slower than that ofaydeegee. see if you can make it faster ?
    thanks a lot.

  8. #8
    Forum Contributor
    Join Date
    01-07-2013
    Location
    south africa
    MS-Off Ver
    Excel 2003-13
    Posts
    210

    Re: comparing the rows in different columns and displaying the results

    Hello
    In principal you need to put more of the information into RAM memory to speed it up. You could play around with feeding the target values into an array and then doing the finding in memory.

    Regards

  9. #9
    Valued Forum Contributor
    Join Date
    09-25-2011
    Location
    Eastbourne, England
    MS-Off Ver
    Excel 2010
    Posts
    1,089

    Re: comparing the rows in different columns and displaying the results

    Hi gencoglu27

    I have made the changes that I suggested. On 14,000 lines it takes 6 seconds to do 100 comparisons (hence 1 minute to do 1000)

    File attached, but most of the 14,000 removed!

    Regards
    Alastair
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    07-10-2007
    Location
    Turkey-Bartın/
    MS-Off Ver
    Ms Office-2007
    Posts
    44

    Re: comparing the rows in different columns and displaying the results

    Hi aydeegee,
    Thank you very much indeed. that's exactly what I need. You did it and saved the day.
    I tested your code and pasted 14.000 lines and compared it to 600 comparisons . It took only less than 30 seconds which is very nice.. you did well on that..

  11. #11
    Valued Forum Contributor
    Join Date
    09-25-2011
    Location
    Eastbourne, England
    MS-Off Ver
    Excel 2010
    Posts
    1,089

    Re: comparing the rows in different columns and displaying the results

    Hi gencoglu27

    .... almost forgot. When you have your big win - remember who provided the code!

    Regards
    Alastair

  12. #12
    Valued Forum Contributor
    Join Date
    09-25-2011
    Location
    Eastbourne, England
    MS-Off Ver
    Excel 2010
    Posts
    1,089

    Re: comparing the rows in different columns and displaying the results

    Hi gencoglu27

    Glad it worked for you.

    Regards
    Alastair

  13. #13
    Registered User
    Join Date
    07-10-2007
    Location
    Turkey-Bartın/
    MS-Off Ver
    Ms Office-2007
    Posts
    44

    Thumbs up Re: comparing the rows in different columns and displaying the results

    Ok...Be sure you will be the first person I will share the treasure with....
    Hello to Eastbourne..

    Take care

    Regards
    Gencoglu

+ 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] Comparing two columns and displaying a third value if they match
    By pdxcollegegrl in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-29-2012, 12:46 PM
  2. Comparing 4 columns and displaying duplicate entries
    By Tonx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2012, 03:26 AM
  3. [SOLVED] Comparing 2 columns and Displaying the associated row in another column
    By William123 in forum Excel General
    Replies: 25
    Last Post: 04-12-2012, 08:18 AM
  4. Replies: 1
    Last Post: 10-28-2010, 12:12 PM
  5. comparing 2 columns and count results
    By lbeamer2688 in forum Excel General
    Replies: 2
    Last Post: 10-16-2008, 05:50 AM

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