-
Notifications
You must be signed in to change notification settings - Fork 3.6k
No Support For R1C1 Style Address in INDIRECT Function #1913
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
Comments
Second argument of INDIRECT is not yet supported "* @todo Support for the optional a1 parameter introduced in Excel 2010". Since it therefore effectively defaults to TRUE where you want FALSE, PhpSpreadsheet could easily be changed to issue a clearer error message, but it will be much harder to get it to support the missing parameter. Would it be difficult for you to use A1 style references rather than R1C1 style, eliminating the need for the optional parameter? |
Not the same problem as #1993, but same function is involved. |
I believe I have a solution. Your sample code is very complicated and incomplete, in that it contains the formula but not the data. If you were to upload (a subset of) the spreadsheet that is giving you this problem, I could try to incorporate that into my unit tests. |
* Improved Support for INDIRECT, ROW, and COLUMN Functions This should address issues #1913 and #1993. INDIRECT had heretofore not supported an optional parameter intended to support addresses in R1C1 format which was introduced with Excel 2010. It also had not supported the use of defined names as an argument. This PR is a replacement for #1995, which is currently in draft status and which I will close in a day or two. The ROW and COLUMN functions also should support defined names. I have added that, and test cases, with the latest push. ROWS and COLUMNS already supported it correctly, but there had been no test cases. Because ROW and COLUMN can return arrays, and PhpSpreadsheet does not support dynamic arrays, I left the existing direct-call tests unchanged to demonstrate those capabilities. The unit tests for INDIRECT had used mocking, and were sorely lacking (tested only error conditions). They have been replaced with normal, and hopefully adequate, tests. This includes testing globally defined names, as well as locally defined names, both in and out of scope. The test case in 1913 was too complicated for me to add as a unit test. The main impediments to it are now removed, and its complex situation will, I hope, be corrected with this fix. INDIRECT can also support a reference of the form Sheetname!localName when localName on its own would be out of scope. That functionality is added. It is also added, in theory, for ROW and COLUMN, however such a construction is rejected by the Calculation engine before passing control to ROW or COLUMN. It might be possible to change the engine to allow this, and I may want to look into that later, but it seems much too risky, and not nearly useful enough, to attempt to address that as part of this change. Several unusual test cases (leading equals sign, not-quite-as-expected name definition in file, complex indirection involving concatenation and a dropdown list) were suggested by @MarkBaker and are included in this request.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Should have been fixed by PR 2004, which was part of Release 18. |
Uh oh!
There was an error while loading. Please reload this page.
This is:
Which versions of PhpSpreadsheet and PHP are affected?
PHP7.42, PhpSpreadsheet tag 1.17.1
The text was updated successfully, but these errors were encountered: