View Single Post
  #8  
Old 06-26-2009, 07:41 PM
contaminated contaminated is offline
Valued Forum Contributor
 
Join Date: 07 May 2009
Location: Baku, Azerbaijan
MS Office Version:Excel 2003/2007
Posts: 702
contaminated is very confident of their ability contaminated is very confident of their ability contaminated is very confident of their ability
Send a message via MSN to contaminated Send a message via Yahoo to contaminated
Re: Find & Retrieve a Set of Data

Shure

First I'll divide this formula on several parts.
Code:
=IFERROR(INDEX(B3:B23,SMALL(IF(F2=A3:A23,ROW(INDIRECT("1:"&ROWS(3:23))),""),ROW(INDIRECT("1:"&ROWS(3:23))))),"")
First is
Code:
=IF(F2=A3:A23,ROW(INDIRECT("1:"&ROWS(3:23))),"")
This formula checks availability of the item selected in dropdown list in A3:A23. If so it'd return their row number generated with formula
Code:
ROW(INDIRECT("1:"&ROWS(3:23)))
Otherwise it'd return blank.
This trick prepares array for SMALL() function. This Array something like this
Code:
"","',"","","","","","","",12,13,14,15,16,17,18,19
Each of this item separated with comma means cell. So without SMALL() function you will get your values somwhere at the bottom. SMALL() allows you to gater 'em at the top. Bur SMALL() has two arguments: RANGE and K. So for K is also
Code:
ROW(INDIRECT("1:"&ROWS(3:23))),"")
'coz it'd return number like 1,2,3,4,5,6... for each cell in the array.
And now it's a time for use INDEX() function after u have got the row number.
So final formula is
Code:
=IFERROR(INDEX(B3:B23,SMALL(IF(F2=A3:A23,ROW(INDIRECT("1:"&ROWS(3:23))),""),ROW(INDIRECT("1:"&ROWS(3:23))))),"")
included in IFERROR() in order to get rid of #NUM! error,,.
Your issue could be done with the help of using helper columns, but this formula gathers three columns into one.
Attached Files
File Type: xlsx Example(1) with explanation.xlsx (11.4 KB, 5 views)
__________________
Regards
Vusal M. Dadashev
Baku, Azerbaijan




Не имея собственного мнения, советы других никогда не будут достаточны
Öz fikirin olmasa, digərlərin məsləhəti sənə heçvaxt kömək ola bilməz.


The only way to read a book of excel formulas without being bored is to open it at random and, having found something that interests you, close the book and meditate.
Reply With Quote