Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Vertical lookup with a lookup value that returns multiple matches

Dear Experts:

I would like to perform a vertical lookup with a lookup value that has
multiple matches.
I know that the VLOOKUP function is designed to return only the
corresponding value of the first instance of a lookup value. I would
like to get a work-around that identifies multiple
matches
Example: In cases where the lookup value (Number of Points) occurs
several times, I would like to return all the results for this lookup
value e.g.:
Points Name
2 Smith
1 Gordon
3 John
2 Holten


Looking up '2 Points' should result in:
Smith
Holten

The result should list the corresponding values in one cell with
manual line breaks (ALT+Enter)
I hope this is feasible. Thank you very much in advance for your
professional help.
Regards, Andreas
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default Vertical lookup with a lookup value that returns multiple matches

Separate cells is doable with a formula.

--

HTH

Bob

"andreashermle" wrote in message
...
Dear Experts:

I would like to perform a vertical lookup with a lookup value that has
multiple matches.
I know that the VLOOKUP function is designed to return only the
corresponding value of the first instance of a lookup value. I would
like to get a work-around that identifies multiple
matches
Example: In cases where the lookup value (Number of Points) occurs
several times, I would like to return all the results for this lookup
value e.g.:
Points Name
2 Smith
1 Gordon
3 John
2 Holten


Looking up '2 Points' should result in:
Smith
Holten

The result should list the corresponding values in one cell with
manual line breaks (ALT+Enter)
I hope this is feasible. Thank you very much in advance for your
professional help.
Regards, Andreas



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Vertical lookup with a lookup value that returns multiple matches

Option Explicit
Sub SAS_filternumbersfornames()
Dim mv As Long
Dim mc As Long
Dim i As Long
Dim ms As String
mv = 2' numberf to look for
mc = 6 'col F
For i = 2 To Cells(Rows.Count, mc).End(xlUp).Row
If Cells(i, mc) = mv Then ms = ms & Cells(i, mc + 1) & Chr(10)
Next i
'MsgBox ms
Cells(1, mc + 2) = ms
End Sub


On Jun 13, 5:02*pm, andreashermle wrote:
Dear Experts:

I would like to perform a vertical lookup with a lookup value that has
multiple matches.
I know that the VLOOKUP function is designed to return only the
corresponding value of the first instance of a lookup value. I would
like to get a work-around that identifies multiple
matches
Example: In cases where the lookup value (Number of Points) occurs
several times, I would like to return all the results for this lookup
value e.g.:
Points Name
2 * * * * Smith
1 * * * * Gordon
3 * * * * John
2 * * * * Holten

Looking up '2 Points' should result in:
Smith
Holten

The result should list the corresponding values in one cell with
manual line breaks (ALT+Enter)
I hope this is feasible. Thank you very much in advance for your
professional help.
Regards, Andreas


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Vertical lookup with a lookup value that returns multiple matches

On Jun 14, 2:35*pm, Don Guillett Excel MVP
wrote:
Option Explicit
Sub SAS_filternumbersfornames()
Dim mv As Long
Dim mc As Long
Dim i As Long
Dim ms As String
mv = 2' numberf to look for
mc = 6 'col F
For i = 2 To Cells(Rows.Count, mc).End(xlUp).Row
If Cells(i, mc) = mv Then ms = ms & Cells(i, mc + 1) & Chr(10)
Next i
* 'MsgBox ms
Cells(1, mc + 2) = ms
End Sub

On Jun 13, 5:02*pm, andreashermle wrote:



Dear Experts:


I would like to perform a vertical lookup with a lookup value that has
multiple matches.
I know that the VLOOKUP function is designed to return only the
corresponding value of the first instance of a lookup value. I would
like to get a work-around that identifies multiple
matches
Example: In cases where the lookup value (Number of Points) occurs
several times, I would like to return all the results for this lookup
value e.g.:
Points Name
2 * * * * Smith
1 * * * * Gordon
3 * * * * John
2 * * * * Holten


Looking up '2 Points' should result in:
Smith
Holten


The result should list the corresponding values in one cell with
manual line breaks (ALT+Enter)
I hope this is feasible. Thank you very much in advance for your
professional help.
Regards, Andreas- Hide quoted text -


- Show quoted text -


Hi John,

Great job. Exactly what I was looking for.

Thank you very much for your terrific help.

Regards, Andreas
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
Need a lookup formula that matches 2 values and returns the 3rd va HFST04 Excel Discussion (Misc queries) 3 February 18th 10 08:04 PM
lookup value if multiple matches are met Go Bucks!!! Excel Worksheet Functions 2 July 23rd 09 06:37 PM
Lookup with multiple matches Gary Excel Discussion (Misc queries) 2 March 11th 09 07:54 PM
Multiple matches using LOOKUP Sonya795 Excel Discussion (Misc queries) 1 August 10th 05 06:13 PM
Is it possible to do a vertical lookup that matches on 2 criteria lshaw Excel Worksheet Functions 4 May 16th 05 07:00 PM


All times are GMT +1. The time now is 01:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"