View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Art Art is offline
external usenet poster
 
Posts: 587
Default vlookup multiple data

Thanks, Jacob! What is there is more than two items?

Sheet 1
A1 = "Me, You"
B1 = (after vlookup) "Art, Joe"

Sheet 2
A1 = "Me" and B1 = "Art"
A2 = "You" and B2 = "Joe"
A3 = "Us" and B2 = "Peter"
A4 = "Her" and B2 = "Janet"
A5 = "Them" and B2 = "Oscar"
A6 = "Him" and B2 = "Henry"


Sheet1A1 could also equal "Me, You, Her, Him" If this was the case, Sheet1B1
should display "Art, Joe, Janet, Henry"

(And, of course, there are no quotes. I just used them here to indicate the
actual values of the cells.)

Can there be a loop-of-sorts to use the vlookup for multiple commas in
Sheet1A1?

Thanks!!!




"Jacob Skaria" wrote:

Try

=VLOOKUP(LEFT(A1,FIND(",",A1)-1),Sheet2!A:B,2,0)&", " &
VLOOKUP(TRIM(MID(A1,FIND(",",A1)+1,255)),Sheet2!A: B,2,0)

--
Jacob


"Art" wrote:

Is it possible to have a cell contain two pieces of informaton (e.g., A1 =
"Me, You"), a vlookup statement to look for each pece of informaton in that
cell (e.g., first "Me", then "You") in another sheet, and display the match
in B1?

Sheet 1
A1 = "Me, You"
B1 = (after vlookup) "Art, Joe"

Sheet 2
A1 = "Me" and B1 = "Art"
A2 = "You" and B2 = "Joe"

I tried all different kinds of =VLOOKUP with different functions, and I
can't figure t out, of course I assume its possble to even use VLOOKUP in
this way. Perhaps I need to use a macro?

Thanks!