![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Join Date: Apr 2002
Posts: 27
|
Is it possible to retrieve multiple cells from a table with one lookup function? For example, I have a table that contains product information. Column A contains a product code, and Columns B thru E contain pricing information. How can I search for a product code then return the related four columns with one function?
Thanks, Bidwin |
|
|
|
|
|
#2 |
|
Join Date: May 2002
Location: Houston, TX
Posts: 5,426
|
Vlookup will return the data based on the product code. You would put the vlookup with the change on the column being returned in each formula,
vlookup(a1,tablelookup,2,0) vlookup(a1,tablelookup,3,0) vlookup(a1,tablelookup,4,0) HTH texasalynn |
|
|
|
|
|
#3 |
|
Join Date: Aug 2003
Location: England
Posts: 4,584
|
Hello,
Do you mean you want all these cells in one cell after the VLOOKUP, if so then you just need to combine texasalynns formula i.e. =vlookup(a1,tablelookup,2,0)&" "&vlookup(a1,tablelookup,3,0)&" "&vlookup(a1,tablelookup,4,0)&" "&vlookup(a1,tablelookup,5,0) the " " just puts a space between the data.
__________________
------------------------- Hope this is helpful. ------------------------- only a drafter, but broadening my Excel knowledge. |
|
|
|
|
|
#4 |
|
Join Date: Apr 2002
Posts: 27
|
Thanks for your replies, Lynn and Drafter. I should have made my question clearer: I want to look up a product code in Column A of a table, retrieve related cells in Columns B thru E, and place the retrieved cells into separate cells, not combine them. My first solution was the same as Lynn's.
Thanks again, Bidwin |
|
|
|
|
|
#5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 39,332
|
Quote:
******** ******************** ************************************************************************>
[HtmlMaker 2.32] To see the formula in the cells just click on the cells hyperlink or click the Name box PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR. Name your lookup table, which can be anywhere outside the retrieval area, PriceTable. In the above exhibit, PriceTable refers to: H3:L4. Formulas... A1:A2 houses lookup values of interest. C1:F1 houses column index values that refer to columns within PriceTable from which you want to retrieve appropriate prices. B2: =MATCH(A2,$H$3:$H$4,0) C2, which is copied across... =IF(ISNA($B2),"",INDEX(PriceTable,$B2,C$1)) Finally, select B2:F2 and copy down. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
#6 |
|
Join Date: Apr 2002
Posts: 27
|
Thanks for the neat solution, Aladin.
Bidwin |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|