+ Reply to Thread
Results 1 to 5 of 5

lookup returning several cells

  1. #1
    Andre
    Guest

    lookup returning several cells

    I'm trying to pull several cells from one worksheet based on a value from
    another worksheet.

    worksheet1
    apples
    oranges
    pears

    worksheet2
    apples green red ripe
    oranges naval Florida round
    pears rotten ready sold

    Based on worksheet1 apples should return from worksheet2, green, red, and
    ripe. Any help is appreciated.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Try this array

    =INDEX(Sheet2!$A$1:$A$3,MATCH(TRUE,ISNUMBER(SEARCH("*"&$A$1:$A$3&"*",A1)),0))

    Use Ctrl + Shift + enter to use

    VBA Noob

  3. #3
    Toppers
    Guest

    RE: lookup returning several cells

    Assuming data i ws2 is in colums A to D AND A1 is value from WS1 e.g "Apple"

    then = VLOOKUP(A1,ws2!A:D,2,false) will return "Green"

    = VLOOKUP(A1,ws2!A:D,3,false) will return "Red"

    = VLOOKUP(A1,ws2!A:D,4,false) will return "Ripe"

    HTH

    "Andre" wrote:

    > I'm trying to pull several cells from one worksheet based on a value from
    > another worksheet.
    >
    > worksheet1
    > apples
    > oranges
    > pears
    >
    > worksheet2
    > apples green red ripe
    > oranges naval Florida round
    > pears rotten ready sold
    >
    > Based on worksheet1 apples should return from worksheet2, green, red, and
    > ripe. Any help is appreciated.


  4. #4
    Andre
    Guest

    RE: lookup returning several cells

    Worked great. Thank you.

    "Toppers" wrote:

    > Assuming data i ws2 is in colums A to D AND A1 is value from WS1 e.g "Apple"
    >
    > then = VLOOKUP(A1,ws2!A:D,2,false) will return "Green"
    >
    > = VLOOKUP(A1,ws2!A:D,3,false) will return "Red"
    >
    > = VLOOKUP(A1,ws2!A:D,4,false) will return "Ripe"
    >
    > HTH
    >
    > "Andre" wrote:
    >
    > > I'm trying to pull several cells from one worksheet based on a value from
    > > another worksheet.
    > >
    > > worksheet1
    > > apples
    > > oranges
    > > pears
    > >
    > > worksheet2
    > > apples green red ripe
    > > oranges naval Florida round
    > > pears rotten ready sold
    > >
    > > Based on worksheet1 apples should return from worksheet2, green, red, and
    > > ripe. Any help is appreciated.


  5. #5
    Andre
    Guest

    Re: lookup returning several cells

    Thank you for the help. Problem solved.

    "VBA Noob" wrote:

    >
    > Hi,
    >
    > Try this array
    >
    > =INDEX(Sheet2!$A$1:$A$3,MATCH(TRUE,ISNUMBER(SEARCH("*"&$A$1:$A$3&"*",A1)),0))
    >
    > Use Ctrl + Shift + enter to use
    >
    > VBA Noob
    >
    >
    > --
    > VBA Noob
    > ------------------------------------------------------------------------
    > VBA Noob's Profile: http://www.excelforum.com/member.php...o&userid=33833
    > View this thread: http://www.excelforum.com/showthread...hreadid=561251
    >
    >


+ 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