Try this. You will have to change the value of the rngMatrix variable to your named range.


VB Code:
  1. Function tobian(ByVal LookupValue As Variant) As Long
  2. Dim rngMatrix As Range
  3.  
  4.         Set rngMatrix = ThisWorkbook.Worksheets(1).Range("B4:C11")
  5.        
  6.         If rngMatrix.Find(What:=LookupValue, _
  7.                             LookIn:=xlValues, _
  8.                             LookAt:=xlWhole, _
  9.                             MatchCase:=False) Is Nothing Then
  10.             tobian = 0
  11.         Else
  12.             tobian = 2
  13.         End If
  14.        
  15.         Set rngMatrix = Nothing
  16. End Function