-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Referencing absolute column range in different sheet fails #1755
Comments
This is still an issue in PhpSpreadsheet 1.16.0 I encountered this with a named range containing a whole column range with $ lock. |
I'm also experiencing this same problem in 1.17. |
The PHPSpreadsheet Calculation engine was never originally designed to handle row or column ranges, just cell ranges, and it was more by chance that they could sometimes be used in formulae; which is why I've always recommended changing formulae to use cell ranges instead. The PR that I've just submitted now provides that support for row/column ranges. Note that 3d range references are NOT supported by these changes. |
Thanks Mark - appreciate your efforts on this one! |
This is:
What is the expected behavior?
Works in Excel fine - would expect it to add the values in the range
=SUM($B:$B)
works=SUM('data'!$B1:$B3)
works=SUM('data'!B:B)
works=SUM('data'!$B:$B)
should work but failsWhat is the current behavior?
Exception thown from
Calculation.php
internalParseFormula()
as it doesn't like the $opCharacter'
and fails at line 4180The absolute column reference in another sheet fails (not just here but also if a named range contains such a range definition)
What are the steps to reproduce?
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
Output for the fail scenario is as follows:-
Which versions of PhpSpreadsheet and PHP are affected?
PHP 7.3.8
This affected PhpSpreadsheet 1.8.2 but I was able to work around it in formulae. Since 1.15.0, named ranges also now expose problem.
The text was updated successfully, but these errors were encountered: