Hi
I suppose that you must use VBA.
Try these code in a module
Option Explicit
Function Areas_Served(data As Range, Date_Sel As Date, Truck As String) As String
Dim x As String, i As Long, j As Long
x = ""
For i = 1 To data.Rows.Count
If data(i, 1) = Date_Sel And data(i, 2) = Truck Then
x = data(i, 3) & ", " & x
End If
Next i
Areas_Served = IIf(Len(x) > 1, Left(x, Len(x) - 2), x)
End Function
If your data without labels is in range ($A$2:$C$18), Date_Sel in F2 and Truck in G2 , use =Areas_Served(A2:C18,F2,G2)
See the file Areas_Served.xlsm
Bookmarks