Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Excel returning more than one value from a lookup table that match the same value

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))

  #2   Report Post  
Posted to microsoft.public.excel.misc
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))



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

Thanks doing it like that appears to work. Any tips on a better way
to do it. I was just going off that micorosft example.

-Nick

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

This formula is more robust, also entered with ctrl + shift & enter

=IF(COLUMNS($B1:B1)<=COUNTIF(Sheet2!$C$2:$C$2934,$ C$2),INDEX(Sheet2!$D$1:$D$2934,SMALL(IF(Sheet2!$C$ 2:$C$2934=$C$2,ROW(Sheet2!$C$2:$C$2934)-COLUMN(Sheet2!$C$2)+3),COLUMNS($B1:B1))),"")


test them side by side

then select column A in the same sheet that holds the formulas and insert a
new column, every time you insert a new column the first formula will change
the result and eventually there will just be blank cells returned while the
above formula still returns the correct result, also it has less function
calls so it should be faster


--


Regards,


Peo Sjoblom

wrote in message
oups.com...
Thanks doing it like that appears to work. Any tips on a better way
to do it. I was just going off that micorosft example.

-Nick



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
index match array function-returning only first match, need last. Julie Olsen Excel Worksheet Functions 3 December 29th 06 12:50 AM
two table lookup match IntricateFool Excel Discussion (Misc queries) 12 October 3rd 06 09:50 PM
table, index, array, match, lookup? spxer Excel Worksheet Functions 2 August 8th 06 09:34 PM
Excel 2002 Lookup formula returning wrong results? Val Excel Worksheet Functions 1 November 18th 05 09:07 PM
Returning row # using match or index of repeated text in a complex table General Excel Worksheet Functions 10 October 21st 05 03:06 PM


All times are GMT +1. The time now is 02:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"