HP Forums

Full Version: Help with spreadsheet formula
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I'm trying to define a formula for the spreadsheet app using this function

Code:
EXPORT cdf_bin_table(n)
BEGIN
STARTAPP("Spreadsheet");
Cell(0,0):=QUOTE(BINOMIAL_CDF(n,Cell(1,Col),Cell(Row,1)));
END;

However would like 'n' to be replaced with the input value. Can I please get a suggestion on how to do this? I've been trying some different combinations of quote, eval, expr, but with what I've tried so far I still have to replace n manually, or every cell is defined as a string. For reference I'm just recreating a table of values for the binomial cdf, and I've set column A to be Row-2, and put some different probabilities in row 1.
Did you try this:

EXPORT cdf_bin_table(n)
BEGIN
STARTAPP("Spreadsheet");
LOCAL s;
s:="QUOTE(BINOMIAL_CDF(" + n + ",Cell(1,Col),Cell(Row,1)))";
Cell(0,0):=EXPR(s);
END;

-road
Reference URL's