Skip to content

Formula Parsing Error Using Union Arguments #503

@SlowFox71

Description

@SlowFox71

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions