You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, let it be made clear this is low-priority, such errors are correctable in-workbook to not make the application crash anymore. This bug report is made only with feature parity in mind.
FixPHPOffice#4381. The report refers to COUNTIF, but AVERAGEIF and SUMIF, which are implemented in the same module, exhibit the same behavior. (There may be others, but, for now, I will just fix those 3.)
Most methods which implement Excel functions should accept mixed arguments, so that they won't throw exceptions when calculated. Of course, MS often doesn't give much guidance as to how unexpected arguments should be handled. It at least seems clear that MS will often substitute #REF! for some arguments, and will return #REF! as the result in such cases. My test indicates that a formula using, say, #DIV/0! in lieu of #REF! will cause Excel to deem the spreadsheet corrupt. So, I think I am just going to deal with #REF! and let other unexpected values continue to throw exceptions.
First of all, let it be made clear this is low-priority, such errors are correctable in-workbook to not make the application crash anymore. This bug report is made only with feature parity in mind.
This is:
What is the expected behavior?
The COUNTIF function fails gracefully and returns "#REF!" too.
What is the current behavior?
Err. 500 with message:
What are the steps to reproduce?
Here is an Excel file to reproduce this behavior with: REF in COUNTIF.xlsx
There are probably more issues regarding errored-out range inputs in COUNTIF.
What features do you think are causing the issue
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Not tested, but probably.
Which versions of PhpSpreadSheet and PHP are affected?
PhpSpreadSheet: 4.0.0
PHP: 8.1
The text was updated successfully, but these errors were encountered: