Can you use a VBA user defined function?
Option Explicit
Sub drv()
With ActiveSheet
MsgBox FindPOData(Range("E3"), Range("F3"), Range("B:C"))
MsgBox FindPOData(Range("E4"), Range("F4"), Range("B:C"))
MsgBox FindPOData(Range("E5"), Range("F5"), Range("B:C"))
End With
End Sub
Function FindPOData(PO1 As String, PO2 As String, POlist As Range, Optional IfNotFound As String = "PO Not Found") As Variant
Dim PO As Range
Set PO = POlist.Columns(1).Find(PO1 & "-" & PO2, POlist.Cells(1, 1), xlValues, xlPart)
If PO Is Nothing Then
Set PO = POlist.Columns(1).Find(PO1 & PO2, POlist.Cells(1, 1), xlValues, xlPart)
End If
If PO Is Nothing Then
FindPOData = IfNotFound
Else
FindPOData = PO.Offset(0, 1).Value
End If
End Function