-
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
ANCHORARRAY() doen't work in validation #4197
Comments
Confirmed. PhpSpreadsheet is not adding the prefix which Excel requires for functions introduced after Excel 2007 (like ANCHORARRAY) to formulas used in Data Validation. While I work out what needs to be done to PhpSpreadsheet, you may be able to work around the problem using the following statement: $validation->setFormula1('_xlfn.ANCHORARRAY($B$1)'); That should be good enough for write. I am unsure whether it will be read correctly when you load a spreadsheet. |
It looks relatively straightforward to handle the formula on read and write. What is not straightforward is getting the |
Fix PHPOffice#4197. Overlooked in the introduction of Dynamic Arrays, Data Validation can specify a list to be a result of the spill operator, which is implemented via the ANCHORARRAY function. It appears that function `DataValidator::isValid` will not work if the list is specified in this manner, nor if it is specified as a defined name. Fixing those situations will be difficult (defined names probably easier than ANCHORARRAY), and there is no reason to delay this change waiting for those to be fixed. I will open a new issue when this PR is merged.
This is:
What is the expected behavior?
The correct rendered of ANCHORARRAY() in validatios
What is the current behavior?
When use ANCHORARRAY() in validations, doesn't rendered
$validation->setFormula1('=ANCHORARRAY($B$1)');
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:
If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.
What features do you think are causing the issue
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Which versions of PhpSpreadsheet and PHP are affected?
The text was updated successfully, but these errors were encountered: