I have a key of the "Values I'm trying to look up", my "Data" and the date ranges in which they fall.
How would I create a function or VBA tool that will look up the values that match to the "Values I'm trying to look up" along with fall between the two dates?
I'd also like to make the out put comma delimited because multiple values can match from the key based on the date range.
I attempted a INDEX function (I think I am entering the references wrong):
=INDEX($I$3:$I$18,MATCH($I$3:$I$18,K2:L2351,IF(E2>=K$2:K$2351,IF(F2<=K$2:K$2351,IF(Value=K$2:K$2351,1))),0))
I'm a beginner with excel any help would be appreciated.
![[enter image description here [enter image description here](/board/proxy.php?image=https%3A%2F%2Fi.stack.imgur.com%2FMnvld.png&hash=d3cdecb7789a33854c1bdebd3080a05a)
I saw this vba on another forum but it does not incorporate the match/vlookup function.
Function SingleCellExtract(LookupValue As String, LookupRange As Range, ColumnNumber As Integer, Char As String)
'Updateby20150824
Dim I As Long
Dim xRet As String
For I = 1 To LookupRange.Columns(1).Cells.Count
If LookupRange.Cells(I, 1) = LookupValue Then
If xRet = "" Then
xRet = LookupRange.Cells(I, ColumnNumber) & Char
Else
xRet = xRet & "" & LookupRange.Cells(I, ColumnNumber) & Char
End If
End If
Next
SingleCellExtract = Left(xRet, Len(xRet) - 1)
End Function
How would I create a function or VBA tool that will look up the values that match to the "Values I'm trying to look up" along with fall between the two dates?
I'd also like to make the out put comma delimited because multiple values can match from the key based on the date range.
I attempted a INDEX function (I think I am entering the references wrong):
=INDEX($I$3:$I$18,MATCH($I$3:$I$18,K2:L2351,IF(E2>=K$2:K$2351,IF(F2<=K$2:K$2351,IF(Value=K$2:K$2351,1))),0))
I'm a beginner with excel any help would be appreciated.
![[enter image description here [enter image description here](/board/proxy.php?image=https%3A%2F%2Fi.stack.imgur.com%2FMnvld.png&hash=d3cdecb7789a33854c1bdebd3080a05a)
I saw this vba on another forum but it does not incorporate the match/vlookup function.
Function SingleCellExtract(LookupValue As String, LookupRange As Range, ColumnNumber As Integer, Char As String)
'Updateby20150824
Dim I As Long
Dim xRet As String
For I = 1 To LookupRange.Columns(1).Cells.Count
If LookupRange.Cells(I, 1) = LookupValue Then
If xRet = "" Then
xRet = LookupRange.Cells(I, ColumnNumber) & Char
Else
xRet = xRet & "" & LookupRange.Cells(I, ColumnNumber) & Char
End If
End If
Next
SingleCellExtract = Left(xRet, Len(xRet) - 1)
End Function