Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Deeds
 
Posts: n/a
Default VlookupS-Alan Beban

I cannot seem to get Mr. Bebans formula to work....I enter the simple formula
as he described in a cell. It is bringing back only the first occurance. My
question is, is it supposed to bring back a list (in the same cell) separated
by commas? Example...I just want to lookup a certain value in a 2 column
list...1st column is where the matching lookup value is and the second
column is where the state is. Now, there may be multiple occurances of
values with different states associated with it. I would like in one cell to
have something like: MN,TX,AZ. Is this possible? If not please explain how
to get the Beban formula to bring back the multiple occurances..do I need it
in multiple cells? multiple columns or rows?..Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Alan Beban
 
Posts: n/a
Default VlookupS-Alan Beban

Deeds wrote:
I cannot seem to get Mr. Bebans formula to work....I enter the simple formula
as he described in a cell. It is bringing back only the first occurance. My
question is, is it supposed to bring back a list (in the same cell) separated
by commas? Example...I just want to lookup a certain value in a 2 column
list...1st column is where the matching lookup value is and the second
column is where the state is. Now, there may be multiple occurances of
values with different states associated with it. I would like in one cell to
have something like: MN,TX,AZ. Is this possible? If not please explain how
to get the Beban formula to bring back the multiple occurances..do I need it
in multiple cells? multiple columns or rows?..Thanks!

The function itself is designed to return to a column the values
associated with the multiple occurrences of the lookup value. E.g.,
with 1,2,3,2,5,6,2,8,9,10 in A1:A10; and MN, TX, AZ in B2, B4, B7,
respectively, if you array enter into a 3-cell column

=VLookups(2,A1:B10,2)

then MN will be returned to the 1st cell, TX to the 2nd cell and AZ to
the 3rd cell. I.e., the function returns an array of the state values
corresponding to the occurrences of the lookup value, in this case 2.

Entered into a single cell, =INDEX(VLookups(2,a1:b10,2),n,1) will return
the state value corresponding to the nth occurrence of the lookup value.
So one way to get the result you are seeking is to enter into a cell
(using the example previously described)

=INDEX(VLookups(2,a1:b10,2),1,1)&","&INDEX(VLookup s(2,a1:b10,2),2,1)&","&INDEX(VLookups(2,a1:b10,2), 3,1)

Perhaps someone will suggest a more elegant (and generalized) solution.

Alan Beban

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Deeds
 
Posts: n/a
Default VlookupS-Alan Beban

Thanks Alan! Based on the boards this one seems pretty tough. Your
suggestion of "&" them together works if I know the exact # of occurances.
However, I do not. I need a formula to look in a 2 column list, compare my
lookup value and return the data in column B that column A matches the lookup
value. Whether it occurs 10 times or 1 time...I just need a list in the same
cell of the results. This seems like it would be a pretty typical or common
need...I can't believe MS has not built something in that can handle
this.....Thanks again for your help....let me know if you have other ideas.
Thanks.

"Alan Beban" wrote:

Deeds wrote:
I cannot seem to get Mr. Bebans formula to work....I enter the simple formula
as he described in a cell. It is bringing back only the first occurance. My
question is, is it supposed to bring back a list (in the same cell) separated
by commas? Example...I just want to lookup a certain value in a 2 column
list...1st column is where the matching lookup value is and the second
column is where the state is. Now, there may be multiple occurances of
values with different states associated with it. I would like in one cell to
have something like: MN,TX,AZ. Is this possible? If not please explain how
to get the Beban formula to bring back the multiple occurances..do I need it
in multiple cells? multiple columns or rows?..Thanks!

The function itself is designed to return to a column the values
associated with the multiple occurrences of the lookup value. E.g.,
with 1,2,3,2,5,6,2,8,9,10 in A1:A10; and MN, TX, AZ in B2, B4, B7,
respectively, if you array enter into a 3-cell column

=VLookups(2,A1:B10,2)

then MN will be returned to the 1st cell, TX to the 2nd cell and AZ to
the 3rd cell. I.e., the function returns an array of the state values
corresponding to the occurrences of the lookup value, in this case 2.

Entered into a single cell, =INDEX(VLookups(2,a1:b10,2),n,1) will return
the state value corresponding to the nth occurrence of the lookup value.
So one way to get the result you are seeking is to enter into a cell
(using the example previously described)

=INDEX(VLookups(2,a1:b10,2),1,1)&","&INDEX(VLookup s(2,a1:b10,2),2,1)&","&INDEX(VLookups(2,a1:b10,2), 3,1)

Perhaps someone will suggest a more elegant (and generalized) solution.

Alan Beban


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ashish Mathur
 
Posts: n/a
Default VlookupS-Alan Beban

Hi,

The following procedure will give you the resukt in multiple rows of the
same column.

Assuming your data is in range A1:B7

Ashish 100
Sanjay 200
Pongal 300
Ashish 400
Rajesh 500
Suresh 600
Ashish 700

In A10, enter Ashish,

In B10, enter the following array formula (Ctrl+Shift+Enter)

=IF(ISERROR(INDEX($A$1:$B$7,SMALL(IF($A$1:$A$7=$A$ 10,ROW($A$1:$A$7)),ROW(1:1)),2)),"",INDEX($A$1:$B$ 7,SMALL(IF($A$1:$A$7=$A$10,ROW($A$1:$A$7)),ROW(1:1 )),2))

Now copy the formula down.

Regards,

Ashish Mathur

"Deeds" wrote:

I cannot seem to get Mr. Bebans formula to work....I enter the simple formula
as he described in a cell. It is bringing back only the first occurance. My
question is, is it supposed to bring back a list (in the same cell) separated
by commas? Example...I just want to lookup a certain value in a 2 column
list...1st column is where the matching lookup value is and the second
column is where the state is. Now, there may be multiple occurances of
values with different states associated with it. I would like in one cell to
have something like: MN,TX,AZ. Is this possible? If not please explain how
to get the Beban formula to bring back the multiple occurances..do I need it
in multiple cells? multiple columns or rows?..Thanks!

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
what is the maximum number of vlookups in a given workbook that E. Bartman Excel Worksheet Functions 2 November 4th 05 04:49 PM
Vlookups array function by Alan Beban FWA Excel Worksheet Functions 2 February 17th 05 09:43 PM
Vlookups array function by Alan Beban falvey3 Excel Worksheet Functions 1 February 17th 05 01:21 PM
Array Functions from Alan Beban Josh O. Excel Worksheet Functions 13 February 5th 05 12:54 AM
Vlookups wmjenner Excel Worksheet Functions 2 November 23rd 04 10:39 PM


All times are GMT +1. The time now is 07:58 AM.

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"