+ Reply to Thread
Results 1 to 15 of 15

Macro to locate matches between data in two columns on two seperate sheets

  1. #1
    Registered User
    Join Date
    08-29-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    8

    Macro to locate matches between data in two columns on two seperate sheets

    I have two sheets,

    sheet1 has three columns of data where A1 is "Problem#", B1 is "Group#" and C1 is "Symptom"
    sheet2 has five columns of data, two of which contain the exact same columns of data from sheet1 where B1 is "Problem#" and C1 is "Group#"

    I would like a macro that will populate a new column on sheet2 in E1 for "Symptom" when BOTH "Problem#" and "Group#" columns from sheet1 are matched with both "Problem#" and "Group#" columns from sheet2.

    Please note that Problem# and Group# are numeric while Symptom is a text value



    Any help here would be greatly appreciated!

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Macro to locate matches between data in two columns on two seperate sheets

    Hi bojangles_73,

    Welcome to the forum.

    Suggest you to upload a sample file to support your query. thanks.


    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey
    +91 9810929744
    dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    08-29-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to locate matches between data in two columns on two seperate sheets

    've attached a file as an example. I have filled in column E on sheet2 manually to illustrate what it should look like.

    Example.xlsxI

    When a match is found between both values in columns B+C sheet2 and columns A+B sheet1, the corresponding symptom on that rowis populated in column E sheet2.

    Thanks in advance for your help!
    Last edited by bojangles_73; 08-30-2012 at 03:23 PM.

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Macro to locate matches between data in two columns on two seperate sheets

    Hi bojangles_73,

    Try using below formula:-

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See attached_ Example(22).xlsx

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  5. #5
    Registered User
    Join Date
    08-29-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to locate matches between data in two columns on two seperate sheets

    Thank you your reply. Unfortunately, I tried the formula you suggested but it is not populating column E sheet 2 with the proper data.

    Could you have a second look at it to see what might be the problem?

    Here is the link with the formula:

    Example(22).xlsx

    Thanks again,

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Macro to locate matches between data in two columns on two seperate sheets

    I guess it is populating correctly..
    Prob# Grp#
    1 1
    From Sheet2, Above need to be matched in Sheet 1 and the answer row on sheet 1 is row number 2 and the result is "Academic Underachievement"

    What you say and basis what logic ?

    Regards,
    DILIpandey

    <click on below 'star' if this helps>

  7. #7
    Registered User
    Join Date
    08-29-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to locate matches between data in two columns on two seperate sheets

    On sheet 2, rows E2-E6 only populate with "Symptom" when it should be "Academic Underachievement" as you said. On Row 20 it populates incorrectly with "Frustration with Child Development and Achievement Level" but a match for 3,1 on sheet 1 should produce "Angry Outbursts" as the answer.

    If I am getting something different, is it possible that my excel/formula settings are incorrect?

    Thanks,

  8. #8
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Macro to locate matches between data in two columns on two seperate sheets

    Oopss.. yes.. you are correct... just change the formula last syntax parts to start from row 1 as below:-

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  9. #9
    Registered User
    Join Date
    08-29-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to locate matches between data in two columns on two seperate sheets

    It is still not providing an answer. When the formula above is entered into cell E2 on sheet 2, it results in "#N/A"

    What could be wrong?

    Thanks,

  10. #10
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Macro to locate matches between data in two columns on two seperate sheets

    okay.. upload the sample workbook.. thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  11. #11
    Registered User
    Join Date
    08-29-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to locate matches between data in two columns on two seperate sheets

    Here it is. Let me know if you can help troubleshoot the problem

    Thanks,
    Attached Files Attached Files

  12. #12
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Macro to locate matches between data in two columns on two seperate sheets

    Hi Bojangles_73,

    You need to enter the formula using key combination Ctrl Shift Enter.. select the formula, press F2, press Ctrl Shift Enter.. done. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  13. #13
    Registered User
    Join Date
    08-29-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Macro to locate matches between data in two columns on two seperate sheets

    Thank you DiliPandey! It worked! You have been very helpful!

  14. #14
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Macro to locate matches between data in two columns on two seperate sheets

    you are welcome bojangles_73... Cheers

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  15. #15
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Macro to locate matches between data in two columns on two seperate sheets

    @ bojangles_73

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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