mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-28 19:19:27 +00:00
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
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
<?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,
|
||||
|
||||
Reference in New Issue
Block a user