Files
PhpSpreadsheet/tests/data/ReferenceHelperFormulaUpdates.php
T
Zaytcev Ivan 89edc5b267 Bug in shared formulas: non-fixed cells are not updated if the formula has a fixed cell (#2354)
Example: right shift shared formula: IF(A$1=0,0,A1/A$1)
Expected value: IF(B$1=0,0,B1/B$1)
Actual value: IF(B$1=0,0,A1/B$1)

Similar behavior is observed when copying formulas vertically.
This issue occurs because a fixed and a non-fixed cell hit the same element of the $newCellTokens array by index $cellIndex
2021-11-04 08:39:58 -07:00

89 lines
1.8 KiB
PHP

<?php
return [
[
'=IF(A$1=0,0,A1/A$1)',
1,
0,
'2021',
'=IF(B$1=0,0,B1/B$1)',
],
[
'=IF($A1=0,0,A1/$A1)',
0,
1,
'2021',
'=IF($A2=0,0,A2/$A2)',
],
[
'=SUM(C3:E5)',
-2,
-2,
'2020',
'=SUM(A1:C3)',
],
[
'=SUM(2020!C3:E5,2019!C3:E5)',
-2,
-2,
'2020',
'=SUM(2020!A1:C3,2019!C3:E5)',
],
[
'=SUM(2020!3:5,2019!3:5)',
-2,
-2,
'2020',
'=SUM(2020!1:3,2019!3:5)',
],
[
'=SUM(2020!C:E,2019!C:E)',
-2,
-2,
'2020',
'=SUM(2020!A:C,2019!C:E)',
],
[
"=IF('2020'!\$B1=\"\",\"-\",(('2020'!\$B1/'2019'!\$B1)-1))",
2,
2,
'2019',
"=IF('2020'!\$B1=\"\",\"-\",(('2020'!\$B1/'2019'!\$B3)-1))",
],
[
"=IF('2020'!B$1=\"\",\"-\",(('2020'!B$1/'2019'!B$1)-1))",
2,
2,
'2019',
"=IF('2020'!B\$1=\"\",\"-\",(('2020'!B\$1/'2019'!D\$1)-1))",
],
[
"=IF('2020'!Z$1=\"\",\"-\",(('2020'!Z$1/'2019'!Z$1)-1))",
2,
2,
'2019',
"=IF('2020'!Z\$1=\"\",\"-\",(('2020'!Z\$1/'2019'!AB\$1)-1))",
],
[
"=IF('2020'!\$B1=\"\",\"-\",(('2020'!\$B1/'2019'!\$B1)-1))",
2,
2,
'2020',
"=IF('2020'!\$B3=\"\",\"-\",(('2020'!\$B3/'2019'!\$B1)-1))",
],
[
"=IF('2020'!B$1=\"\",\"-\",(('2020'!B$1/'2019'!B$1)-1))",
2,
2,
'2020',
"=IF('2020'!D\$1=\"\",\"-\",(('2020'!D\$1/'2019'!B\$1)-1))",
],
[
"=IF('2020'!Z$1=\"\",\"-\",(('2020'!Z$1/'2019'!Z$1)-1))",
2,
2,
'2020',
"=IF('2020'!AB\$1=\"\",\"-\",(('2020'!AB\$1/'2019'!Z\$1)-1))",
],
];