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

Formula return #N/A in PhpSpreadsheet but OK in Excel #3396

Closed
1 task done
nelero opened this issue Feb 23, 2023 · 2 comments · Fixed by #3392
Closed
1 task done

Formula return #N/A in PhpSpreadsheet but OK in Excel #3396

nelero opened this issue Feb 23, 2023 · 2 comments · Fixed by #3392

Comments

@nelero
Copy link

nelero commented Feb 23, 2023

This is a bug report

What is the expected behavior?

CalculatedValue should return the same as in Excel

What is the current behavior?

The CalculatedValue() returns #N/A

What are the steps to reproduce?

In a sheet :
I've got a table in A60:C63 with periods and percentage

A B C
59 start end percent
60 01/01/1950 03/06/2016 5%
61 04/06/2016 05/01/2021 8%
62 06/01/2021 08/04/2022 3%
63 09/04/2022 31/12/2500 4%

If in cell D5 i have an amount. in E5 i have a date. and i want to retrieve the percentage for the matching period. And then apply the percentage to the amount.
So the formula in Excel is :
=IF(E5<>"",LOOKUP(2,1/($A$60:$A$63<=E5)/($B$60:$B$63>=E5),$C$60:$C$63)*D5,"")

In excel, the value is well calculated.
But when i open with PHPSpreadSheet, ->getCalculatedValue() returns #N/A

What features do you think are causing the issue

  • Formula Calculations

Does an issue affect all spreadsheet file formats? If not, which formats are affected?

I only tested in a xlsm file

Which versions of PhpSpreadsheet and PHP are affected?

Latest version

@oleibman
Copy link
Collaborator

This is probably related to issue #3389. PR #3392 does not yet solve it. Researching.

@oleibman
Copy link
Collaborator

PR 3392 updated to address this problem.

@MarkBaker MarkBaker removed their assignment Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants