You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [x] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
What is the expected behavior?
Array formulae should be written to an XLSX file so that the value is computed when the XLSX is opened.
What is the current behavior?
When writing an array formula to a cell and then saving to XLSX, the resulting XLSX displays a #NAME? error when first opened. Editing the cell (but not changing the formula) and re-saving the file fixes the issue.
What are the steps to reproduce?
I know the formula is a bit odd, but it's related to something I'm working on.
Note that MS have been changing the way that array formulae are managed in MS Excel, and that PhpSpreadsheet 2.0 will provide full support for all the new array formula features, rather than the limited partial support provided in the current version... when I can manage to complete all the merges from master since I created that 2.0-dev branch.
This is:
What is the expected behavior?
Array formulae should be written to an XLSX file so that the value is computed when the XLSX is opened.
What is the current behavior?
When writing an array formula to a cell and then saving to XLSX, the resulting XLSX displays a
#NAME?
error when first opened. Editing the cell (but not changing the formula) and re-saving the file fixes the issue.What are the steps to reproduce?
I know the formula is a bit odd, but it's related to something I'm working on.
I have attached two sample XLSX Files. One demonstrating the issue, and one created after my proposed fix.
Test.xlsx
Test - Fixed.xlsx
The issue appears to be caused by this block of code in the
writeCellFormula
inphpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php
:I think it should be writing out the function prefixes, like in the
else
below. In my testing this change fixes the issue:What features do you think are causing the issue
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Only tested on XLSX
Which versions of PhpSpreadsheet and PHP are affected?
PHP 7.4, PhpSpreadsheet 1.27
The text was updated successfully, but these errors were encountered: