Summary
Elementwise operations over a vertical range lose column orientation: =A1:A3*2 (with A1:A3 vertical = 1,2,3) returns a 1×N row [[2,4,6]] instead of the N×1 column [[2],[4],[6]] Google Sheets produces — so it spills horizontally instead of down.
This is the range half of #707. The SEQUENCE/array-constructor half was fixed in #723; this range half was deliberately deferred because it's a larger change.
Why it's separate / harder
resolve_range (crates/workbook/src/recalc.rs) materializes every range as a flat row-major array, so a vertical range loses its orientation before core's eval ever sees it. A trial fix to make range materialization shape-aware broke 4 pinned conformance fixtures — AVERAGE(Data!A1:A3)→#DIV/0!, SUMIF(Data!A1:A3,">15")→0, AVERAGE(PRICES)→#DIV/0!, MAX(PRICES)→#REF! — because core's aggregation/criteria helpers (flatten_to_vec, etc.) flatten only one level of a nested array.
What the real fix needs
- Make range materialization shape-aware (a vertical range → N×1, horizontal → 1×N), AND
- Make the aggregation/criteria helpers (
flatten_to_vec and friends) fully flatten nested arrays so AVERAGE/SUM/SUMIF/MAX/etc. over a range still work.
- Do it together so no fixture regresses.
Impact
=<vertical range> <op> <scalar> (e.g. =A1:A3*2, =A1:A3+1) spills horizontally instead of down, diverging from Sheets. Lower urgency than the SEQUENCE case (which #723 fixed and is the common one), but a real remaining divergence and the completion of #707.
Acceptance
Related
Summary
Elementwise operations over a vertical range lose column orientation:
=A1:A3*2(with A1:A3 vertical = 1,2,3) returns a 1×N row[[2,4,6]]instead of the N×1 column[[2],[4],[6]]Google Sheets produces — so it spills horizontally instead of down.This is the range half of #707. The
SEQUENCE/array-constructor half was fixed in #723; this range half was deliberately deferred because it's a larger change.Why it's separate / harder
resolve_range(crates/workbook/src/recalc.rs) materializes every range as a flat row-major array, so a vertical range loses its orientation before core's eval ever sees it. A trial fix to make range materialization shape-aware broke 4 pinned conformance fixtures —AVERAGE(Data!A1:A3)→#DIV/0!,SUMIF(Data!A1:A3,">15")→0,AVERAGE(PRICES)→#DIV/0!,MAX(PRICES)→#REF! — because core's aggregation/criteria helpers (flatten_to_vec, etc.) flatten only one level of a nested array.What the real fix needs
flatten_to_vecand friends) fully flatten nested arrays soAVERAGE/SUM/SUMIF/MAX/etc. over a range still work.Impact
=<vertical range> <op> <scalar>(e.g.=A1:A3*2,=A1:A3+1) spills horizontally instead of down, diverging from Sheets. Lower urgency than theSEQUENCEcase (which #723 fixed and is the common one), but a real remaining divergence and the completion of #707.Acceptance
=A1:A3*2over a vertical range returns an N×1 column (spills down).AVERAGE/SUM/SUMIF/MAX) unchanged — the 4 fixtures still pass.Related