Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Lookup to return multiple results in one cell
Name # of cats
Jack X123 Jack X224 Lisa X123 Ben Z324 Derek X123 Derek Z324 Above is my example data set. Ideally what I would like to do is be able to have concatonated results on one line based off a lookup. E.g. I look for Jack and the formula returns: "X123, X224" in one cell. Is there anything out there that can do that? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Lookup to return multiple results in one cell
Function MyLookup(LookFor, FindCol As Range, GetCol As Range) As
String For Each c In FindCol If LookFor = c Then If MyLookup = "" Then MyLookup = Cells(c.Row, GetCol.Column) Else MyLookup = MyLookup & ", " & Cells(c.Row, GetCol.Column) End If End If Next c End Function You may want to add some error checking. Hth, Merjet |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Lookup to return multiple results in one cell
On Apr 12, 1:21 pm, "merjet" wrote:
Function MyLookup(LookFor, FindCol As Range, GetCol As Range) As String For Each c In FindCol If LookFor = c Then If MyLookup = "" Then MyLookup = Cells(c.Row, GetCol.Column) Else MyLookup = MyLookup & ", " & Cells(c.Row, GetCol.Column) End If End If Next c End Function You may want to add some error checking. Hth, Merjet Hello, I know near to nothing about VBA, would you tell me how to use your macro? Thanks in advance, Armando |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to return multiple results in a cell | Excel Discussion (Misc queries) | |||
lookup single value in one sheet, return multiple results from theother sheet | Excel Worksheet Functions | |||
lookup one value in list and return multiple results | Excel Worksheet Functions | |||
V lookup with 2 criteria to return results for multiple columns | Excel Worksheet Functions | |||
Return Multiple Results with Lookup | Excel Worksheet Functions |