Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.
Option Explicit
Function RecursiveLookup(Id As Range, Table As Range)
Application.Volatile
Dim i As Long, arTable As Variant
arTable = Table
For i = LBound(arTable, 1) To UBound(arTable, 1)
If arTable(i, 1) = Id Then
If Len(RecursiveLookup) = 0 Then
RecursiveLookup = arTable(i, 2)
Else
RecursiveLookup = RecursiveLookup + " OR " + arTable(i, 2)
End If
End If
Next i
If Len(RecursiveLookup) = 0 Then
RecursiveLookup = "NOT FOUND***"
End If
End Function
=RecursiveLookup(A2,$G$2:$H$13)
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.