+ Reply to Thread
Results 1 to 8 of 8

Extracting values from a list?

  1. #1
    Registered User
    Join Date
    03-03-2009
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    53

    Extracting values from a list?

    Sample Data:
    Col A: Col B:
    CV01 01
    CV01 01B
    CV01 02
    CV01 08
    CV01 03
    CV01 10
    CV02 02
    CV02 02B
    CV02 03
    CV02 10
    CV02 01
    CV02 09
    CV03 06
    CV03 06B
    CV03 04B
    CV03 05B
    CV03 08
    CV03 09

    I need to generate/extract a "list" of all the values in Col B. that "belong" to each value in Col A. So, if my criteria is "CV02," I need the list to be 02,02B,03,10,01,09 (with each value in it's own cell)

    I've tried the "VLOOKUP" function, but it only returns the last value for each criteria (example =VLOOKUP(CV01,A1:B18,2) returns "10")

    I've searched these forums, but I'm not really sure what search criteria to use... I'm stumped. Any help would be greatly appreciated.
    Last edited by Tomkat; 06-15-2009 at 10:52 AM.

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

    Re: Extracting values from a list?

    I just posted a suggestion to a very similar problem...

    Check here:

    http://www.excelforum.com/excel-prog...-the-text.html
    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
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Extracting values from a list?

    Assuming G1 contains CV02 use this array formula in H1

    =IF(ISERROR(SMALL(IF($A$1:$A$20=$G$1,ROW($A$1:$A$20),""),ROW($A1))),"",
    INDEX($B$1:$B$20,SMALL(IF($A$1:$A$20=$G$1,ROW($A$1:$A$20),""),ROW($A1))))

    and copy down

  4. #4
    Registered User
    Join Date
    03-03-2009
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Extracting values from a list?

    Thanks!

    OK, I'll give it a try, but after looking at the formula, I'm not sure how to modify it to suit my exact situation.

  5. #5
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Extracting values from a list?

    Quote Originally Posted by Tomkat View Post
    Thanks!

    OK, I'll give it a try, but after looking at the formula, I'm not sure how to modify it to suit my exact situation.
    What is that exact situation that needs a modifictaion?

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

    Re: Extracting values from a list?

    Quote Originally Posted by Tomkat View Post
    Thanks!

    OK, I'll give it a try, but after looking at the formula, I'm not sure how to modify it to suit my exact situation.

    Looking at the formula I supplied in the other thread and modifying it to more precise search

    Please Login or Register  to view this content.
    you would replace each instance of red $A$1:$A$100 with your actual range contain your lookup range.. you would replace the blue $A$1:$A$100 with the range of things you want returned..

    The $B$1 is the cell containing your criteria to search for in the red $A$1:$A$100

    Make sure to confirm the formula with CTRL+SHIFT+ENTER and then copy down.
    Last edited by NBVC; 06-15-2009 at 09:27 AM.

  7. #7
    Registered User
    Join Date
    03-03-2009
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Extracting values from a list?

    I forgot to mention that even though the formula is on one sheet, the range that I want returned is on another sheet, but I finally figured it out... Using Bob's formula as a "template"

    Please Login or Register  to view this content.
    I tried using A:A instead of $A$1:$A$1000, etc, (since the range can grow indefinitely) but it didn't work, so I figured $A$1000 should cover it, hopefully.

    Thanks for everyone's help!
    Last edited by Tomkat; 06-15-2009 at 10:20 AM.

  8. #8
    Forum Contributor
    Join Date
    11-24-2008
    Location
    Delhi
    Posts
    104

    Re: Extracting values from a list?

    Hey Try This UDF

    Kindly find the Attached file

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by NBVC; 06-17-2009 at 07:50 AM. Reason: Added code tags

+ 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