View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default use vlookup with offset function

Try this:

Assume your data is in the range A2:E8

Drop down in cell A11

Enter this formula in cell B11 and copy across to E11:

=IF(ROWS(B$11:B11)<=COUNTIF($A$2:$A$8,$A$11),INDEX (B$2:B$8,MATCH($A$11,$A$2:$A$8,0)+ROWS(B$11:B11)-1),"")

Select the range B11:E11 and copy down to a number of rows that is equal to
the maximum count of any single selection in your drop down list. For
example, "merchandise" appears the most times in your table. It appears 3
times so you have to copy the formulas to at least 3 rows.

Screencap:

http://img107.imageshack.us/img107/6554/lookupuy0.jpg

--
Biff
Microsoft Excel MVP


"liem" wrote in message
...
I have a drop down menu when I selected a item (merchandise...) I want to
return three row and four columns (B to e)
drop down menu merchandise
Gasoline
Food
A B c d e
merchandise john robert 500 40 4 .2%
merchandise jeff gordon 800 90 4.5%
merchandise julia robel 1000 90 6.5%
gasoline mak dune 50 34 3,2%
gasoline nancy thom 90 37 8.1%
gasoline john good 200 34 5.4%
food john 19 11 4.4%

what is the formula when I used vlookup(merchandise ...)
--
thanks