HP Forums
Help with spreadsheet formula - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Help with spreadsheet formula (/thread-19876.html)



Help with spreadsheet formula - ftneek - 04-30-2023 06:30 AM

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.


RE: Help with spreadsheet formula - roadrunner - 04-30-2023 09:58 AM

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