Re: [sc-dev] How should MULTIPLE.OPERATIONS calculate?

2009-06-21 Thread Regina Henschel

Hi all,

Regina Henschel schrieb:

Hi all,

thinking about issue 102980 and 102981 I found, that it is not clear to 
me, how to calculate MULTIPLE.OPERATIONS at all.


Take a spreadsheet and enter the following numbers and formulas into 
column A, beginning in cell A1 with number 2.


2
3
=A1+A2
30
=MULTIPLE.OPERATIONS(A3;A2;A4)
700
=MULTIPLE.OPERATIONS(A5;A2;A6)



I forgot to say, that the above mentioned values for A3 and A5 are only 
internal, temporary. The real sheet shows in A3 the value 5 and in A5 
the  value 32. There is no doubt about it. Only the value in A7 is in 
question.


kind regards
Regina

-
To unsubscribe, e-mail: dev-unsubscr...@sc.openoffice.org
For additional commands, e-mail: dev-h...@sc.openoffice.org



[sc-dev] How should MULTIPLE.OPERATIONS calculate?

2009-06-21 Thread Regina Henschel

Hi all,

thinking about issue 102980 and 102981 I found, that it is not clear to 
me, how to calculate MULTIPLE.OPERATIONS at all.


Take a spreadsheet and enter the following numbers and formulas into 
column A, beginning in cell A1 with number 2.


2
3
=A1+A2
30
=MULTIPLE.OPERATIONS(A3;A2;A4)
700
=MULTIPLE.OPERATIONS(A5;A2;A6)

What do you expect in cell A7? OOo3 calculates the value 702.

In ODF1.2 draft spec I read, "MULTIPLE.OPERATIONS executes the formula 
expression pointed to by FormulaCell and _all_ formula expressions it 
depends on while replacing _all_ references to RowCell with references 
to RowReplacement respectively all references to ColumnCell with 
references to ColumnReplacement."


I think that the terms "execute formula expression" and "while 
replacing" is not exact enough.


(1) I interpret it in the way, that I first replace all references, 
generating intermediate, temp sheets, and then evaluate that sheet. I 
get the following:


For =MULTIPLE.OPERATIONS(A5;A2;A6) we have to replace in the content of 
A5 all references to A2 with A6. So content of A5 becomes 
=MULTIPLE.OPERATIONS(A3;A6;A4).
But A3 is not a finite number but a formula which depends on A1 and A2. 
Therefore in A3 the reference A2 is also replaced with A6 and the 
content of A3 becomes =A1+A6.

Our new sheet content with replaced references is now:
2
3
=A1+A6
30
=MULTIPLE.OPERATIONS(A3;A6;A4)
700


With this sheet we have to take the value of A5 as result for A7.

Calculating the value of A5 we have to execute a MULTIPLE.OPERATION. It 
says that the reference A6 in the formula in A3 is to be replaced with 
the reference A4.

We get the next temp speat content:

2
3
=A1+A4
30

700


with the inner-outer-order of calculating A3 then A5 then A7. So the 
shown values are


2
3
32 //result of =A1+A4
30
32 //result of A3
700
32 //result of A5

(2) I replace the reference in the formula expression referenced by 
FormulaCell and then immediately execute that expression.


For =MULTIPLE.OPERATIONS(A5;A2;A6) we have to replace in the content of 
A5 all reference to A2 with A6. So content of A5 becomes 
=MULTIPLE.OPERATIONS(A3;A6;A4). This results in the sheet

2
3
=A1+A2
30
=MULTIPLE.OPERATIONS(A3;A6;A4)
700


Calculating the result of A5 we have to replace all references A6 in 
cell content A3 with A4. This results in the sheet


2
3
=A1+A2 // There is no A6 reference
30

700


We calculate the results in inner-outer-order first A3 then A5 then A7, 
and get the sheet


2
3
5 //result of A1+A2
30
5 //result of A3
700
5 //result of A5

Mmh, neither (1) nor (2) results in 702.

kind regards
Regina

-
To unsubscribe, e-mail: dev-unsubscr...@sc.openoffice.org
For additional commands, e-mail: dev-h...@sc.openoffice.org