+ Reply to Thread
Results 1 to 8 of 8

Finding Rows with Multiple Cell Matches Between Two Data Sets

  1. #1
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Finding Rows with Multiple Cell Matches Between Two Data Sets

    do you need any reference on sheet 3 to the row in sheet one that generated the result otherwise the output doesnt seem to tell you a lot?

    Jmac
    Last edited by zbor; 07-20-2014 at 03:56 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Finding Rows with Multiple Cell Matches Between Two Data Sets

    No worries, I admit to using some of these posts on the forum as a means of forcing myself to learn new things as well as helping other users, it is a form of repayment for previous help i have received)

    Your reply suggests that the basic logic is the same, we just need to add some more data in the output (this is before I look at your second attachment).

    One question, will the always be names in each row always be present until the first "null" cell is found, ie is the situation where col a = name, col b = null, col c = name valid or will the first null col = finished this row??

    Jmac
    Last edited by zbor; 07-20-2014 at 03:58 PM.

  3. #3
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Finding Rows with Multiple Cell Matches Between Two Data Sets

    Hi
    just to confirm I have your requiremetns understood, why is new project 4 (wheat crossovers) not included in the output report as it seems old project 6 (wheat crops in middle america) seem to have romero & graves in common??

    Or have I missed an important point??

    Jmac
    Last edited by zbor; 07-20-2014 at 04:02 PM.

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Finding Rows with Multiple Cell Matches Between Two Data Sets

    Try the attached. It works for the example workbook, but I did not extensively test it with a larger set of data.
    Attached Files Attached Files
    多么想要告诉你 我好喜欢你

  5. #5
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Finding Rows with Multiple Cell Matches Between Two Data Sets

    AgroData_Solution.xlsm

    Subject to both of us finding a potential report output line that you didnt I think this example will also produce the results you are looking for.

    I haven't look closely at solution from millz (it does produce the same results) but I will learn from it as it looks a more elegant solution for an experienced VBA coder. I am only learning myself so I often take a slow methodical long route to the solution. In my defence I am not a current professional software developer

    jmac
    Last edited by zbor; 07-20-2014 at 04:03 PM.

  6. #6
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Finding Rows with Multiple Cell Matches Between Two Data Sets

    Quote Originally Posted by jmac1947 View Post
    but I will learn from it as it looks a more elegant solution
    As long as it works, it is still a working solution. That was actually what I was trying to avoid - having too many loops, since user mentioned that there are about 3000 * 30000 rows, and each row have individual names to look through as well.

    I learned something from your solution too never knew about GoSub and Return combination.
    Last edited by zbor; 07-20-2014 at 04:42 PM.

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,006

    Finding Rows with Multiple Cell Matches Between Two Data Sets

    Hi Everyone,

    I'm familiar using formulas, but I have a new challenge that I think might be better suited to VBA, which I've just started learning. Here's the situation.

    On Sheet1, I have a data set 15 columns wide, with 3,000 rows down.
    On Sheet2, I have a data set 15 columns wide, with 30,000 rows down.

    The goal is:

    A) Find all the rows in Sheet1 that have two or more cell matches with any row on Sheet2, and
    B) Display the matches, row by row on Sheet3.

    A (tiny) mock-up (with randomly generated names) is attached. Hoping someone can help.
    Attached Files Attached Files
    Never use Merged Cells in Excel

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,006

    Re: Finding Rows with Multiple Cell Matches Between Two Data Sets

    Hi Jmac,

    Nice catch. I totally missed that. Yes, that also should have been included in the report.

    It's getting late here, so I'll stop back in and check this thread tomorrow after work.

    Actually, it's more helpful to have code from both an experienced coder and from someone a bit newer to things. That gives me an opportunity to compare and contrast, and learn. It's actually a plus.

    Thanks so much for your help. Honestly, it's going to take some time for me to digest the code, since I'm still new to VBA, but I'll go ahead and mark this as solved.

    Cheers

+ 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. Finding matches on six criteria in two data sets on two different worksheets
    By jake diamond in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 01-23-2014, 10:22 PM
  2. [SOLVED] Finding multiple matches of a single input across multiple rows and columns
    By gingerdog in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-07-2012, 02:54 PM
  3. To convert data in multiple sets of columns to multiple rows
    By Dhanya_nair in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2012, 02:49 PM
  4. Replies: 2
    Last Post: 07-14-2008, 03:24 PM

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