File tree 1 file changed +9
-2
lines changed
src/PhpSpreadsheet/Calculation
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -3664,8 +3664,15 @@ private function _parseFormula($formula, Cell $pCell = null)
3664
3664
$ val = $ rangeWS2 . $ endRowColRef . $ val ;
3665
3665
} elseif ((ctype_alpha ($ startRowColRef )) && (ctype_alpha ($ val )) &&
3666
3666
(strlen ($ startRowColRef ) <= 3 ) && (strlen ($ val ) <= 3 )) {
3667
- // Column range
3668
- $ endRowColRef = ($ pCellParent !== null ) ? $ pCellParent ->getHighestRow () : 1048576 ; // Max 1,048,576 rows for Excel2007
3667
+ // Column range
3668
+ $ refSheet = $ pCellParent ;
3669
+
3670
+ // see https://github.com/PHPOffice/PhpSpreadsheet/issues/1215
3671
+ $ rangeSheetName = \str_replace ('! ' , '' , $ rangeWS1 );
3672
+ if ($ rangeSheetName !== $ pCellParent ->getTitle ()) {
3673
+ $ refSheet = $ pCell ->getWorksheet ()->getParent ()->getSheetByName ($ rangeSheetName );
3674
+ }
3675
+ $ endRowColRef = ($ pCellParent !== null ) ? $ refSheet ->getHighestRow () : 1048576 ; // Max 1,048,576 rows for Excel2007
3669
3676
$ output [count ($ output ) - 1 ]['value ' ] = $ rangeWS1 . strtoupper ($ startRowColRef ) . '1 ' ;
3670
3677
$ val = $ rangeWS2 . $ val . $ endRowColRef ;
3671
3678
}
You can’t perform that action at this time.
0 commit comments