Hi, I think its because you have "Cost" and "DNET" being <> than an "Empty String" when the variables are doubles, It should be a Numerical ref.
Your Code modified below works.
Public Function oREF(Cost As Double, DNET As Double) As String
If Cost <> 0 Then
    If DNET <> 0 Then
        oREF = Cost * DNET
    Else
    oREF = ""
    End If
Else
oREF = ""
End If
End Function
Regards Mick