Using Excel defined functions in UDF


M

Matthew.M.Snow

I'm trying to create a UDF that allows users to input to binomial
experiments and the results will be a p-value for comparing the
proportions.

My function crashes everytime I try to use an excel built in function
like

SQRT(X) or NORMSDIST(X)... etc

SQRT I got around by using (X) ^ 0.5 and I found a formula that got me
close the normdist, but I'd like to use the exact formula in excel

Thanks,
Matt
 
Ad

Advertisements

B

Bob Phillips

VBA has its own Sqrt functiojn called Sqr.

One way to get at functions that don't work in VBA bnormally is tio use
evaluate, such as

Application.Caller.Parent.Evaluate("SQRT(" & inVal & ")")

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top