I have the following table:
the lookup funcion in my case gives me the dates (06/08/2018) rate of 3.5% as this date falls in between the dates in the lookup table. I am struggling to produce same function in vba.
Function GetDateRate(dateValue As Date, dateRange As Range, valuesRange As Range)
GetCurrentRate = Application.WorksheetFunction.Lookup(2, 1 / (dateRange <= dateValue), valuesRange)
End Function
But unfortunatly it fails... how can I fix that?

