Sorry, I should have said... This is in Excel not Access. I've updated my first post.
That said, it gave me the idea to try using VBA rather than formula... I wrote the following which is very slow but working...
Function GetCostPrice(x, y As Range)
Dim lBC As String
Dim dDate As Date
Dim...