-
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
Fails to calculate INDEX() function #64
Comments
Turns out, $arrayValues passed to INDEX method is a 2 level array which is causing the issue.
|
You are probably experiencing the same issue as PHPOffice/PHPExcel#1091. If you are able to provide a PR to solve it, that would very much appreciated. |
It's different from that issue. I'll submit a report for that one coz it's still occurring in this package. Then, i'll drop a PR for fix on both issues. |
There appears to be a breakage when I pulled the latest dev copy. Not sure which commit caused this. Now the $arrayValues only recieved the last element. My fix no longer works because of this.
|
I will take a look, and understand the issue, and see if I can fix it |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Probably the oldest bug I've worked on on this project. Fix will be available in a day or two. |
Fix #64 (really!), closed as stale in December 2017, another in our "better late than never" series. Excel's INDEX function doesn't really behave quite as described. If a single row is used as an argument, either in literal form `{item1, item2, item3}` or expressed as a range `A1:A6`, INDEX is happy to evaluate the array as if each entry were a row rather than a single item. PhpSpreadsheet is changed to do likewise. INDEX also returned `#REF!` when it would normally return an array (which would often be reduced to its leftmost topmost entry later). This code is deleted, invalidating one existing test, and INDEX will now operate like other functions which can return arrays.
Sample formula:
=INDEX({"First","Second","Third","Fourth","Fifth","Sixth","Seventh"}, 4)
Errors thrown:
Undefined offset: 3 in
/var/www/html/hoosh/excel_v2/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php on line 603
Undefined index: in /var/www/html/hoosh/excel_v2/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php on line 610
The text was updated successfully, but these errors were encountered: