Closed wojciechczerniak closed 3 years ago
@izulin Not the same. This task is about arrays defined in the standard: https://docs.oasis-open.org/office/OpenDocument/v1.3/csprd02/part4-formula/OpenDocument-v1.3-csprd02-part4-formula.html#__RefHeading__1017866_715980110
@izulin Not the same. This task is about arrays defined in the standard: https://docs.oasis-open.org/office/OpenDocument/v1.3/csprd02/part4-formula/OpenDocument-v1.3-csprd02-part4-formula.html#__RefHeading__1017866_715980110
Could you point to feature from the standard that is not implemented?
AFAIK you can't just type in the formula: = {1} + {1;2;3|4;5;6}
and get value {2;3;4|5;6;7}
as described in the use cases.
The notation was removed?
You can with #671
What do you mean by removed
?
Ok, didn't noticed that. I've seen tests with that notation removed in previous PRs, like ={TRANSPOSE( ... )}
.
If you say we're here then I will definitely check #671 and the spec more carefully again ❤️
Removal of old ={TRANSPOSE( ... )}
was step towards supporting this (modern) array notation.
Done with so many PR that I can't list them here. See changelog for v1.
Description
ODFF defines Inline Arrays, Excel has Array Formulas/Constants.
{1;2|3;4}
where;
is a column separator (,
in Excel) and|
is a row separator (;
in Excel). IMO both should be a configuration options #58Values rules
Examples
={1;2|3;4}
will result in:=SEQUENCE(1,12)*2
or={1,2,3,4;5,6,7,8;9,10,11,12}*2
. You can also divide with (/), add with (+), and subtract with (-).=SEQUENCE(1,12)^2
or={1,2,3,4;5,6,7,8;9,10,11,12}^2
=SQRT(SEQUENCE(1,12)^2)
or=SQRT({1,2,3,4;5,6,7,8;9,10,11,12}^2)
=TRANSPOSE(SEQUENCE(1,5))
or=TRANSPOSE({1,2,3,4,5})
. Even though you entered a horizontal array constant, the TRANSPOSE function converts the array constant into a column.=TRANSPOSE(SEQUENCE(5,1))
or=TRANSPOSE({1;2;3;4;5})
. Even though you entered a vertical array constant, the TRANSPOSE function converts the constant into a row.=TRANSPOSE(SEQUENCE(3,4))
or=TRANSPOSE({1,2,3,4;5,6,7,8;9,10,11,12})
. The TRANSPOSE function converts each row into a series of columns.=SUM(F10:F19*G10:G19)
or=SUM(F10*G10,F11*G11,F12*G12,F13*G13,F14*G14,F15*G15,F16*G16,F17*G17,F18*G18,F19*G19)
Naming Inline Arrays (Array Formulas/Constants)
This can be done with Named Expressions API #126
Rember to use it with
=
sign:=Quarter1
. OtherwiseQuarter1
should be parsed as text.Evaluation
SPILL Error
Until the blockage is removed. Then everything should be displayed as normal.
Links
ODFF: https://docs.oasis-open.org/office/OpenDocument/v1.3/csprd02/part4-formula/OpenDocument-v1.3-csprd02-part4-formula.html#__RefHeading__1017968_715980110 ODFF: https://docs.oasis-open.org/office/OpenDocument/v1.3/csprd02/part4-formula/OpenDocument-v1.3-csprd02-part4-formula.html#__RefHeading__1017908_715980110 ODFF: https://docs.oasis-open.org/office/OpenDocument/v1.3/csprd02/part4-formula/OpenDocument-v1.3-csprd02-part4-formula.html#__RefHeading__1017866_715980110 Array formulas: https://support.office.com/en-us/article/guidelines-and-examples-of-array-formulas-7d94a64e-3ff3-4686-9372-ecfd5caa57c7 Dynamic vs constant arrays: https://support.office.com/en-us/article/dynamic-array-formulas-vs-legacy-cse-array-formulas-ca421f1b-fbb2-4c99-9924-df571bd4f1b4 Using arrays: https://wiki.openoffice.org/wiki/Documentation/How_Tos/Using_Arrays