ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   lookup to return multiple values (https://www.excelbanter.com/excel-discussion-misc-queries/207906-lookup-return-multiple-values.html)

Andy

lookup to return multiple values
 
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

Gary''s Student

lookup to return multiple values
 
Use a User Defined Function
--
Gary''s Student - gsnu200810


"Andy" wrote:

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


Mike H

lookup to return multiple values
 
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
"Andy" wrote:

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



All times are GMT +1. The time now is 05:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com