Post Reply 
Help with spreadsheet formula
04-30-2023, 06:30 AM
Post: #1
Help with spreadsheet formula
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.


Attached File(s) Thumbnail(s)
   

- neek
Find all posts by this user
Quote this message in a reply
04-30-2023, 09:58 AM
Post: #2
RE: Help with spreadsheet formula
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
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 4 Guest(s)