MS Office Forum / Excel / Worksheet Functions / March 2007
Vlookup for multiple row data
|
|
Thread rating:  |
David B - 05 Feb 2007 16:20 GMT I need to create a lookup formula that will find all employees for a given store location. My data is organized as follows:
Store # Employee name 10 Bob 10 Jane 10 Kelly 12 Ted 12 David 12 James 12 Carrie 16 Joe 16 Kristin 16 Al 16 Nick 16 John
The obstacle I've encountered with a VLookup is that if I look for Store #12, my formula only returns the first employee for store #12. I need to create a formula that will extract all the employees, then create a new table with that data.
Help!
Dave F - 05 Feb 2007 16:30 GMT I would use a pivot table to summarize data by Store #.
For more info on pivot tables, see here: http://www.cpearson.com/excel/pivots.htm
Dave
 Signature A hint to posters: Specific, detailed questions are more likely to be answered than questions that provide no detail about your problem.
> I need to create a lookup formula that will find all employees for a given > store location. My data is organized as follows: [quoted text clipped - 19 lines] > > Help! David B - 05 Feb 2007 16:43 GMT Dave,
Thanks for your quick reply and excellent suggestion...unfortunately, my ultimate use for this spreadsheet for for implimentation in a Crystal Xcelsius dashboard, and Xcelsius will not work with a pivot table (at least not that I can determine)...
I'm trying to work with some combination of Match and Index functions..."Offset" is also not compatible with Xcelsius...
> I would use a pivot table to summarize data by Store #. > [quoted text clipped - 26 lines] > > > > Help! Dave F - 05 Feb 2007 16:56 GMT Can;t you just sort by Store #?
 Signature A hint to posters: Specific, detailed questions are more likely to be answered than questions that provide no detail about your problem.
> Dave, > [quoted text clipped - 36 lines] > > > > > > Help! David B - 05 Feb 2007 17:02 GMT The data I will be working with will be sorted by store #; But I am working with 75 or so stores, with 10-15 employees per store. So, I need to create a formula that will "extract" all employees for a given store, and place the data in a new worksheet.
My expertise with Lookup formulas is limited. I understand how to use "Vlookup" to select a store and return the requested data, but not when there are multiple rows of data with the same store number.
> Can;t you just sort by Store #? > [quoted text clipped - 38 lines] > > > > > > > > Help! Max - 05 Feb 2007 17:06 GMT Perhaps this could be an option ..
Source data in Sheet1's cols A and B, from row2 down
In Sheet2, Assume Store # will be input in B1
In A2: =IF(Sheet1!A2="","",IF(Sheet1!A2=$B$1,ROW(),"")) Leave A1 empty
In B2: =IF(ROW(A1)>COUNT(A:A),"",INDEX(Sheet1!B:B,SMALL(A:A,ROW(A1)))) Select A2:B2, copy down to cover the max expected extent of data in Sheet1. Hide away col A. Col B returns the required results all neatly bunched at the top.
 Signature Max Singapore http://savefile.com/projects/236895 xdemechanik ---
> Dave, > [quoted text clipped - 5 lines] > I'm trying to work with some combination of Match and Index > functions..."Offset" is also not compatible with Xcelsius... David B - 05 Feb 2007 17:15 GMT Max,
Thanks for your reply; again an excellent suggestion. But, Xcelsius is not able to use "row" functions. I had previously run into this limitation with another spreadsheet.
> Perhaps this could be an option .. > [quoted text clipped - 21 lines] > > I'm trying to work with some combination of Match and Index > > functions..."Offset" is also not compatible with Xcelsius... Max - 05 Feb 2007 18:03 GMT Sad to hear it's not an option, David. Probably you would have earlier ruled out using an autofilter on the store# col as well? Just a thought.
 Signature Max Singapore http://savefile.com/projects/236895 xdemechanik ---
> Max, > Thanks for your reply; again an excellent suggestion. But, Xcelsius is not > able to use "row" functions. I had previously run into this limitation with > another spreadsheet. Dave F - 05 Feb 2007 18:06 GMT Why can;t you use Max's suggestion and paste the values? Do you need to retain the formulas?
 Signature A hint to posters: Specific, detailed questions are more likely to be answered than questions that provide no detail about your problem.
> Sad to hear it's not an option, David. Probably you would have earlier ruled > out using an autofilter on the store# col as well? Just a thought. > > Max, > > Thanks for your reply; again an excellent suggestion. But, Xcelsius is not > > able to use "row" functions. I had previously run into this limitation with > > another spreadsheet. David B - 05 Feb 2007 18:11 GMT Crystal Xcelsius is a dynamic graphing/dashboard application that takes the underlying excel data (and formulas) and uses it to produce really nice interactive displays....so I actually have to build the underlying formulas into excel, which ultimately gets embedded in Xcelsius and provides the dynamic content.
Usually, all of the suggestions here would work very well, but I'm having to try to build the excel sheet to ultimately work with Xcelsius....and Xcelsius support is pretty poor (unless you own their really expensive "enterprise" product!)
> Why can;t you use Max's suggestion and paste the values? Do you need to > retain the formulas? [quoted text clipped - 5 lines] > > > able to use "row" functions. I had previously run into this limitation with > > > another spreadsheet. Dave F - 05 Feb 2007 18:22 GMT Sounds like you need a different tool than Xcelsius then.
 Signature A hint to posters: Specific, detailed questions are more likely to be answered than questions that provide no detail about your problem.
> Crystal Xcelsius is a dynamic graphing/dashboard application that takes the > underlying excel data (and formulas) and uses it to produce really nice [quoted text clipped - 16 lines] > > > > able to use "row" functions. I had previously run into this limitation with > > > > another spreadsheet. Duke Carey - 05 Feb 2007 19:41 GMT Treat your data as a database, then on the sheet where you want the filtered data to appear, go to Data->Import External Data->New Database Query
If you walk through the steps there, you'll see how you can identify the Excel file as the database, and the range of data as a table. Use the help file in Query to learn how to create a parameter query linked to a cell, and plan for that cell to hold a store number. Once you've created your query and identified the cell, you can change the cell value and run the query. It'll bring in all the pertinent data
> I need to create a lookup formula that will find all employees for a given > store location. My data is organized as follows: [quoted text clipped - 19 lines] > > Help! David B - 07 Feb 2007 16:04 GMT Duke,
Thank you for your input....unfortunately, because of some limitations of Crystal Xcelsius (the application this excel spreadsheet "feeds") I have to limit my data manipulation to formulas I can embed in the actual file; Vlookup and Hlookup formulas are generally very helpful, but the data I need to manipulate for this application is throwing me a curve ball....
> Treat your data as a database, then on the sheet where you want the filtered > data to appear, go to Data->Import External Data->New Database Query [quoted text clipped - 29 lines] > > > > Help! Sujith - 10 Feb 2007 08:26 GMT > Duke, > [quoted text clipped - 37 lines] > > > > Help! Hi, Xcelcius does allow you to have a "filter selector" that can solve your problem. Or creating an unique id based on store#&Employee name and then use that to find information. Hope this helps Sujith
Charlie_Brown - 21 Mar 2007 17:19 GMT I understand the limitations of Xcelsius and am new to Office Online. The idea here is to create a serial number by store that a vlookup formula can find. Column A concatenates C&B Columna B use an If formula that re-sets the serialization to 1 as the store number changes B3=IF(D3=D2,1+C2,1)
1 A B C D 2 Concatenate.Serial Store # Employee name 3 101 1 10 Bob 4 102 2 10 Jane 5 103 3 10 Kelly 6 121 1 12 Ted 7 122 2 12 David 8 123 3 12 James 9 124 4 12 Carrie 10 161 1 16 Joe 11 162 2 16 Kristin 12 163 3 16 Al 13 164 4 16 Nick 14 165 5 16 John 15 16 Input Store number 12 17 Concatenate.Serial Employee name 18 121 1 Ted 19 122 2 David 20 123 3 James 21 124 4 Carrie 22 125 5 23 126 6 24 127 7 A18=$D$16&A18 and copied down Formula D17=IF(B17>COUNTIF(C2:$C$13,$C$15),"",VLOOKUP(A17,$A$2:$D$13,4,FALSE)) The countif determines how many employee's per store. I hope this helps. Charlie_Brown
> I need to create a lookup formula that will find all employees for a given > store location. My data is organized as follows: [quoted text clipped - 19 lines] > > Help!
|
|
|