Closed blacknell closed 4 years ago
I have tracked this down to the formula parser in src/PhpSpreadsheet/Calculation/Calculation.php:3710
which checks all known cases operator by operator and then complains if the operator is unknown.
The operator being checked is a single quote in =SUM('data'!$B:$B)
at position 4 (so the opening quote mark here).
Although I can see the failure I really don't understand from the code the logic of how it is parsing and therefore how to fix
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue for you, please try to help by debugging it further and sharing your results. Thank you for your contributions.
I had the same problem...
Changing
=VLOOKUP(I2;Sheet10!$B:$Z;4;FALSE)
to
=VLOOKUP(I2;Sheet10!$B1:$Z100;4;FALSE)
is a workaround. But I dont know, what's the performance for this and it's hard to have fixed amount of lookup array.
Would it be possible to fix?
Supplied code now works correctly. Removing stale label, leaving issue closed.
This is:
What is the expected behavior?
The whole column reference in a cell to a relative range in another sheet
'data'!$B:$B
should evaluate just as it does if in the current sheet=SUM($B:$B)
works=SUM('data'!B:B)
works=SUM('data'!$B1:$B3)
works=SUM('data'!$B:$B)
should workThe
$
symbol is, of course, used in Excel to indicate a relative rangeWhat is the current behavior?
=SUM('data'!$B:$B)
throws an uncaught exception Formula Error: An unexpected error occurred from method_parseFormula()
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php:3710
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:
Which versions of PhpSpreadsheet and PHP are affected?
PHP 7.2.21 PhpSpreadsheet 1.9.0