View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Juggernnath Juggernnath is offline
external usenet poster
 
Posts: 8
Default what's wrong with custom function?

Function RsGlaso(gama, API, T, Pb)
' Application.Volatile False

Dim Rs As Double, KorekcioniPb As Double
'gama = gas gravity - input testData=0.732
'API = ro [API] - input testData=38
'T - [F] - input testData=180
'Pb - [psi] - input testData=3811

KorekcioniPb = 10 ^ (2.8869 - (14.1811 - 3.3093 * Log(Pb)) ^ 0.5)
'Rs = gama * (((API ^ 0.989) / (T ^ 0.172)) * KorekcioniPb) ^ 1.2255
Rs = gama * (((API ^ 0.989) / (T ^ 0.172)) * KorekcioniPb) ^ 1.2255
RsGlaso = 5
End Function


It works if I type formulas into spreadsheet, but if I defined it as custom
function it returns #VALUE