13
1
Rules
No cell range references (
A2:B3).Maximum 9 rows and 9 columns.
No circular references or formula errors.
Empty cells evaluate to
0.Data are numbers only, but may be taken as strings.
Formulas are strings.
Implementation choices
You must state your choices in these matters:
Require formulas to be prefixed with any single character, e.g.
=– or not.The leftmost cell of the second row is
A2orR2C1, as per the two conventions used by Excel et al.Require any single-character pre- or suffix in cell references, e.g.
$– or not.One of null, empty string, empty list, etc., (but not
0) to represent empty cells.Language of your submission (spreadsheet managers are not allowed).
Language for the formulas (may differ from the above).*
Brownie points or cookies for explaining your solution.
Examples
Choices: 7: =; 8: A2; 9: none; 10: ""; 12: Excel Formula Language
In:
[[ 2, 3],
["=A1+B1",""]]
Out:
[[2,3],
[5,0]]
In:
[[ 2,"=A1+B2"],
["=A1+B1", ""]]
Out:
[[2,2],
[4,0]]
In:
[[ 3, 4,"=A1*B1"],
[ 2, 5,"=A2*B2"],
["","","=C1+C2"]]
Out:
[[3,4,12],
[2,5,10],
[0,0,22]]
In:
[["","=2*B2*B3" ,""],
[ 3,"=A1+(A2+C2)/2", 2],
[ 1,"=C1+(A3+C3)/2", 5]]
Out:
[[0,15, 0],
[3, 2.5,2],
[1, 3 ,5]]
* The formula language must be PPCG admissible, but you only have to support cell references plus criteria 3 and 4 there, wiz. addition and primeness determination.
Is submitted an answer in Excel/VBA disallowed?
Expand array to cells, evaluate.– Magic Octopus Urn – 2017-04-06T17:15:41.213@carusocomputing If you are not just letting Excel do its thing, then feel free to post. – Adám – 2017-04-07T05:08:21.017
Can we have cells be zero-based? As in,
R0C0? – Conor O'Brien – 2017-04-07T15:57:50.850@ConorO'Brien No, it has to be one of the two conventions used by Excel et al. – Adám – 2017-04-09T04:42:15.907