How about a user defined function? copy and paste the below into a standard code module:Use the function in the spreadsheet by typing:![]()
Public Function GetPrice(ItemNumbers As Range, strTargetItem As String, strDate As String) For Each c In ItemNumbers If c.Value = strTargetItem Then If c.Offset(0, 2).Value = strDate Then GetPrice = c.Offset(0, 1).Value Exit For End If End If Next End Function
Into the cell where you want the result to appear, then click the fx button to the left of the formula bar.![]()
=GETPRICE(
For the ItemNumbers argument, select the range that contains the Item Numbers for which you want to find the price.
For the strTargetItem argument, enter the Item number you want to match or select a cell that contains the item number used as a search cell (it doesn't have to be part of the data table).
For the strDate, enter the date you want to match, or select a search cell containing the date.
Bookmarks