I am running Excel 365 (installed locally) on Win11 Pro. I have created the following UDF with Anaconda Code and compare its output with Excel’s built-in formula
With Excel formula
=NORM.S.DIST(1, TRUE)
0.84134475
With Anaconda Code
from scipy.stats import norm
@UDF(name='my_test1', nested=False)
def my_test1(x) -> float:
return norm.cdf(x)
@UDF(name='my_test2', nested=False)
def my_test2(x) -> float:
return float(norm.cdf(x))
I expect my_test1()
to return a numeric value, but it returns a text
instead.
I had to manually cast the output to a numeric value using the float()
function as shown in my_test2()
. This seems like a bug, right?