Skip to content

PPMT() function should not asserts that rate is a positive number #2163

Closed
@majermi4

Description

This is:

- [x] a bug report

What is the expected behavior?

In an native excel, the =PPMT (rate, per, nper, pv, [fv], [type]) function allows rate parameter to be a negative value.

Screenshot 2021-06-15 at 18 34 17

What is the current behavior?

The changes added in this commit/line now trigger error when calculating value of the PPMT function when negative rate value is given to it.

I have to admit that I'm not an expert on what the PPMT function does and how it is meant to be used but we have a lot of excel files from experts in the financial industry and they seem to use a negative rate value in this function which now causes our app to crash.

My proposed solution is to simply remove that one line of validation which will make PHPOffice/PhpSpreadsheet behave consistently with native excel.

Which versions of PhpSpreadsheet and PHP are affected?

Effected PhpSpreadsheet version: 1.18.0 and higher

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