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
Confirmed. Calculating this value is done with iterative guesses using the Newton-Raphson method, and we've seen other problems using that method for XIRR. We were able to correct it due to the work of others implementing XIRR in other languages; a cursory search does not reveal similar activity for TINV, so solving this may take a long time.
Also of note - PhpSpreadsheet currently uses the same code for T.INV as TINV, and leaves T.INV.2T unimplemented. In fact, T.INV.2T is supposed to yield the same (hopefully correct) result as TINV, and T.INV needs a new algorithm altogether (and should be marked as unimplemented till we figure out what that is). Similarly, T.DIST.2T, currently unimplemented, should yield the same result as TDIST.
It actually looks like TDIST might be at fault rather than TINV. In Excel, =TDIST(1.8373862310371,1,2) evaluates to 0.31703; in PhpSpreadsheet, it evaluates to just about 0.05, which is why TINV thinks that that 1.8... is the answer. If that is the case, this might be an easier problem to solve than I'd feared, since TDIST does not use iterative guessing to come up with its result.
oleibman
changed the title
The TINV formula result is different from MS Excel / LibreOffice when the degrees of freedom is 1
Problems with TDIST, TINV, and Related Functions
Sep 21, 2024
This is:
What is the expected behavior?
It should returns:
12.7062047
What is the current behavior?
It returns:
1.8373862310371
What are the steps to reproduce?
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:
What features do you think are causing the issue
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Not sure.
Which versions of PhpSpreadsheet and PHP are affected?
2.2
The text was updated successfully, but these errors were encountered: