View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Peo Sjoblom Peo Sjoblom is offline
external usenet poster
 
Posts: 3,268
Default Excel returning more than one value from a lookup table that match the same value

Since you are extracting values from D2:D2934 there is no need to include C
in the index part then add 2 for the D column, also you need to offset the
INDEX part since row() will always count from the first row but if you
change INDEX to start in D1 instead it will work, something like this

=IF(ISERROR(INDEX(Sheet2!$D$1:$D$2934,SMALL(IF(She et2!$C$2:$C$2934=$C$2,ROW(Sheet2!$C$2:$C$2934)),CO LUMN(A:A)))),"",INDEX(Sheet2!$D$1:$D$2934,SMALL(IF (Sheet2!$C$2:$C$2934=$C$2,ROW(Sheet2!$C$2:$C$2934) ),COLUMN(A:A))))

note that it is not the best formula you can use for this, there are better
faster and more robust ways to get this


--


Regards,


Peo Sjoblom



wrote in message
oups.com...
I was following the instructions on
http://office.microsoft.com/en-us/ex...260381033.aspx
to return all the values that match a corresponding lookup value in a
table and I have gotten it working using their steps. The problem
I'm having is I need the formula to work when I fill it across the
colums instead of down the rows. I want the returned results to
appear on the same row horizonatally next to the lookup number instead
of in several rows beside it. I've been playing with the formula but
I cant seem to get it to cooperate. Anyone have any ideas.


=IF(ISERROR(INDEX(Sheet2!$C$2:$D$2934,SMALL(IF(She et2!$C$2:$C$2934=$C
$2,ROW(Sheet2!$C$2:$C$2934)),ROW(1:1)),2)),"",INDE X(Sheet2!$C$2:$D
$2934,SMALL(IF(Sheet2!$C$2:$C$2934=$C$2,ROW(Sheet2 !$C$2:$C
$2934)),ROW(1:1)),2))