Generate a list through Vlookup?

  • Thread starter Thread starter Alon
  • Start date Start date
A

Alon

Hi,
I need to generate a list according to the following
guide lines.
I have a list of numbers in colomn A and B.
I want to search for values in colomn A and get the
corrosponding value from colomn B (as in vlookup).
However a certain value may appear a number of times in
colomn A and thus the result maybe a list of numbers and
not a single number.
Any ideas how to do this?
Thanks,
Alon
 
Hi Alon; I have a way that I have used for several
different projects - I warn you that it is ugly, but it
works:
I'll assume you have a header row so your data starts at
2nd row, if not you will need to adjust these formulas
make cell C2 = COUNTIF(A$1:A2,A2)&":"&A2
make cell D2 = IF(COUNTIF(A$1:A2,A2)=1,"",VLOOKUP(COUNTIF
(A$1:A2,A2)-1&":"&A2,C:D,2,FALSE)&", ")&B2
you can change the ":" to anything else if your data
already has that, just be sure to change it in both
formulas
can also change the ", " to some other list divider
now drag both down to end of your data - voila (I told you
it was ugly, but you should see your list now)
 
Hi,
Thanks! It works.
As you said a bit ugly but .... ;-)

I wonder why such a simple function is not supported.
Alon
 
Back
Top