- Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed as not planned
Description
This is:
- [X] a bug report - [ ] a feature request - [X] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet) What is the expected behavior?
Parsing the this formula correctly: =RANK(B1,(C1,D1))
What is the current behavior?
Throwing an exception "Formula Error: Unexpected ,"
What are the steps to reproduce?
Create an Excel file with a formula like the above and try to read the cell content.
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:
<?php require __DIR__ . '/vendor/autoload.php'; // Create new Spreadsheet object $spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet(); // add code that show the issue here... $sheet = $spreadsheet->getActiveSheet(); $sheet->setCellValueExplicit('A1', '=RANK(B1, (C1, D1))', \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_FORMULA); $value = $sheet->getCell('A1')->getCalculatedValue(); ?>Which versions of PhpSpreadsheet and PHP are affected?
PHP 7.0, PhpSpreadsheet 1.2.1
Please note that this is a valid formula; excel accepts lists of cells instead of ranges without complaining.
Metadata
Metadata
Assignees
Labels
No labels