lookup to return multiple values

  • Thread starter Thread starter Andy
  • Start date Start date
A

Andy

hi is there a way to use the lookup function and return all the values in ONE
cell that match the criteria, and not just the first or largest one?
Thanks
 
Hi,

I assume this is related to your previous post. How about a UDF. Alt+F11 to
open VB editor, Right click 'This Workbook' and insert module and paste the
code below in on the right

Call with

=ListProjects(A1:A100,A1)

Where a1 - a100 is your list of names and a1 is the name your looking for.

Function ListProjects(rng As Range, mgr As String) As String
For Each c In rng
If c.Value = mgr Then
ListProjects = ListProjects + c.Offset(, 1).Text & " , "
End If
Next
End Function

Mike
 
Back
Top