Hi
Easiest way I can think to do this is build your own function.
In a general module of the spreadsheet where the data exists, enter the code
Function MyMatch(rng1 As Range, rng2 As Range)
Dim arr()
cntr = 0
For i = 1 To rng1.Rows.Count - rng2.Rows.Count + 1
ReDim Preserve arr(cntr)
holder = ""
For j = 1 To rng2.Rows.Count
holder = holder & rng1(i + j - 1) & ","
Next j
arr(cntr) = Left(holder, Len(holder) - 1)
cntr = cntr + 1
Next i
For i = 1 To rng2.Rows.Count
strr = strr & rng2(i) & ","
Next i
strr = Left(strr, Len(strr) - 1)
On Error Resume Next
matcher = WorksheetFunction.Match(strr, arr, 0)
On Error GoTo 0
If matcher = "" Then
MyMatch = "Not found"
Else
MyMatch = matcher
End If
End Function
Say your historical data is on sheet1!A1:B15 (including headings) and your test data is in sheet1!F1:G7 (including headings) then enter the formula
=mymatch(B2:B15,G2:G7)
See how that goes.
rylo
Bookmarks