+ Reply to Thread
Results 1 to 17 of 17

Lookup to find and output multiple values in different worksheet

  1. #1
    Registered User
    Join Date
    12-29-2009
    Location
    Milwaukee, US
    MS-Off Ver
    Excel 2007
    Posts
    25

    Lookup to find and output multiple values in different worksheet

    Hi,
    I’m trying to use Lookup to generate a traceability matrix. For each requirement in worksheet A, I want to input what all test cases are present in Worksheet 2. By using the lookup, it just returns the first occurrence and not the others. Attached is that example sheet. Any help would be highly appreciated.
    Thanks
    Attached Files Attached Files
    Last edited by harsh2209; 03-08-2010 at 06:22 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup to find and output multiple values in different worksheet

    Add this udf to your VB Editor (ALT+F11, Insert|Module)

    Please Login or Register  to view this content.
    Then use formula in E2:

    =SUBSTITUTE(TRIM(aconcat(IF('Test Cases'!$A$2:$A$34=B2,'Test Cases'!$B$2:$B$34,"")," "))," ",",")

    and confirm it with CTRL+SHIFT+ENTER not just ENTER and copy it down
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    12-29-2009
    Location
    Milwaukee, US
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Lookup to find and output multiple values in different worksheet

    Thanks NVBC!

    However, I'm trying to understand why I'm getting all test case numbers which do not have any requirement mapped against some requirements..Could you please see what happens if some of the test cases do not have a requirement id?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup to find and output multiple values in different worksheet

    Are you confirming the formula with CTRL+SHIFT+ENTER so that you get { } brackets around the formula?

  5. #5
    Registered User
    Join Date
    12-29-2009
    Location
    Milwaukee, US
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Lookup to find and output multiple values in different worksheet

    Thanks Again, Yes I'm doing it. It works very well.

    One more thing. So, is it also possible that the logic picks up more then one requirements separated by comma from one cell.
    Please see the example in the attached file - 'Example2.xlsm'
    Attached Files Attached Files
    Last edited by harsh2209; 03-03-2010 at 04:25 PM.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup to find and output multiple values in different worksheet

    Did you attach another file?

  7. #7
    Registered User
    Join Date
    12-29-2009
    Location
    Milwaukee, US
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Lookup to find and output multiple values in different worksheet

    Sorry, I did now..

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup to find and output multiple values in different worksheet

    Try:

    =SUBSTITUTE(TRIM(aconcat(IF(ISNUMBER(SEARCH(B2,'Test Cases'!$A$2:$A$34)),'Test Cases'!$B$2:$B$34,"")," "))," ",",")

    confirmed with CTRL+SHIFT+ENTER and copied down.

  9. #9
    Registered User
    Join Date
    12-29-2009
    Location
    Milwaukee, US
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Lookup to find and output multiple values in different worksheet

    Again, works like a charm!

    Thanks a lot!

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup to find and output multiple values in different worksheet

    Great!

    Can you remember to please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  11. #11
    Registered User
    Join Date
    12-29-2009
    Location
    Milwaukee, US
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Lookup to find and output multiple values in different worksheet

    Sure! but, what if I have some more questions..do I open a new thread?

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup to find and output multiple values in different worksheet

    If it is directly related to this actual question, then no Mark it back to No Prefix and then ask..

    ... if is not directly related, then start a new thread.. you can add link to here if you feel it necessary...

  13. #13
    Registered User
    Join Date
    12-29-2009
    Location
    Milwaukee, US
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Lookup to find and output multiple values in different worksheet

    Hi NBVC,

    The solution you proved work well. Here is one discrepancy that I have come across.

    The formula & macro cannot differentiate between requirement '6.2.0' and '16.2.0'. So, the test cases mapped to 16.2.0, 16.2.1 are also getting automatically mapped to 6.2.0 and 6.2.1...

    Attached example2.xlsm with the scenario..

    Any thought/ way out..
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    12-29-2009
    Location
    Milwaukee, US
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Lookup to find and output multiple values in different worksheet

    The formula & macro cannot differentiate between requirement '6.2.0' and '16.2.0'. So, the test cases mapped to 16.2.0, 16.2.1 are also getting automatically mapped to 6.2.0 and 6.2.1...

    Attached example2.xlsm with the scenario..

    Any thought/ way out..

  15. #15
    Registered User
    Join Date
    12-29-2009
    Location
    Milwaukee, US
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Lookup to find and output multiple values in different worksheet

    Could you please help...

  16. #16
    Valued Forum Contributor
    Join Date
    08-23-2009
    Location
    Hampshire, UK
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    328

    Re: Lookup to find and output multiple values in different worksheet

    Try

    =SUBSTITUTE(TRIM(aconcat(IF(B2='Test Cases'!$A$2:$A$40,'Test Cases'!$B$2:$B$40,"")," "))," ",",")

    entered as an array formula.

  17. #17
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup to find and output multiple values in different worksheet

    Try:

    Please Login or Register  to view this content.
    CSE confirmed

+ 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