Skip to content
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

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

Closed
majermi4 opened this issue Jun 15, 2021 · 2 comments
Closed

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

majermi4 opened this issue Jun 15, 2021 · 2 comments

Comments

@majermi4
Copy link

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

@MarkBaker
Copy link
Member

There was a time when MS provided decent, consistent documentation on all of the Excel functions, not simply providing an example or two, but detailing all the validations, and the errors that would be returned. Sadly, that is no longer the case.

@PowerKiKi
Copy link
Member

Fixed in 1.19.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants