Rolly_Sefu
Board Regular
- Joined
- Oct 25, 2013
- Messages
- 149
Hy
As an index formula would work =Index(A1:A10,Match(C1,B1:B10,0)) this is the most basic index and match.
I need to get multiple results in the same cell divided by a comma based on a value: C1
So I created this function:
My question is how can I get the result from result_range and not use the cell.offset ?
As an index formula would work =Index(A1:A10,Match(C1,B1:B10,0)) this is the most basic index and match.
I need to get multiple results in the same cell divided by a comma based on a value: C1
So I created this function:
Code:
Function speciallookup(result_range As Range, lookup_range As Range, lookup_criteria As Double) As String
'result_range=A1:A10
'lookup_range=B1:B10
'lookup_criteria=C1
For Each cell In lookup_range
If cell = lookup_criteria Then
x = x & cell.Offset(0, -1) & ", "
End If
Next cell
speciallookup = Left(x, Len(x) - 2)
End Function
My question is how can I get the result from result_range and not use the cell.offset ?