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

BETADIST function does not work correctly #40

Open
ScottDWagner opened this issue Oct 28, 2015 · 4 comments
Open

BETADIST function does not work correctly #40

ScottDWagner opened this issue Oct 28, 2015 · 4 comments

Comments

@ScottDWagner
Copy link

This function does not appear to be working correctly
In FormulaJS:
BETADIST(1/52,0.4,9.6)
FormulaJS = 9.966606842186747
Excel = 0.540601367

Could some one check this out for me.

@0x333333
Copy link
Contributor

According to MS Excel documentation: BETA.DIST function takes at least four parameters:

  • X
  • Alpha
  • Beta
  • Cumulative

I'm not sure which version of Excel you are using, but in Online Excel and MS Excel for Mac v15.13 the function BETA.DIST accepts at least four parameters.

Here's my result in MS Excel:

BETA.DIST(1/52, 0.4, 9.6, TRUE) = 0.540601637
BETA.DIST(1/52, 0.4, 9.6, FALSE) = 9.966606952

In Formula.js if you only specified three parameters, Cumulative will be treated as false. Probably it could be better that Formula.js can throw an exception that when Cumulative is not specified, keep it the same way as MS Excel.

@ScottDWagner
Copy link
Author

Ok I see in Excel 2013 the Last variable is not required. Basically it considers it true if you don’t put it in.

From: Zhipeng JIANG [mailto:[email protected]]
Sent: Wednesday, October 28, 2015 5:30 PM
To: sutoiku/formula.js [email protected]
Cc: ScottDWagner [email protected]
Subject: Re: [formula.js] BETADIST function does not work correctly (#40)

According to MS Excel documentation: BETA.DIST function https://support.office.com/en-my/article/BETA-DIST-function-11188c9c-780a-42c7-ba43-9ecb5a878d31?ui=en-US&rs=en-MY&ad=MY&fromAR=1 takes at least four parameters:

  • X
  • Alpha
  • Beta
  • Cumulative

I'm not sure which version of Excel you are using, but in Online Excel and MS Excel for Mac v15.13 the function BETA.DIST accepts at least four parameters.

Here's my result in MS Excel:

BETA.DIST(1/52, 0.4, 9.6, TRUE) = 0.540601637
BETA.DIST(1/52, 0.4, 9.6, FALSE) = 9.966606952

In Formula.js if you only specify three parameters, Cumulative will be treated as false. Probably it could be better that Formula.js can throw an exception that when Cumulative is not specified, keep it the same way as MS Excel.


Reply to this email directly or view it on GitHub #40 (comment) . https://github.com/notifications/beacon/AJXx6LoGD0h42bfUA9T7B9q9T5o5Np3Jks5pAUPMgaJpZM4GXwsh.gif

@ScottDWagner
Copy link
Author

I see it now in Excel 2013 the last variable is considered true if you do not input it. I will fix this on my app Thank you so much.

0x333333 added a commit to 0x333333/formula.js that referenced this issue Oct 28, 2015
Issue:

Following latest MS Excel documentation: [BETA.DIST](https://support.office.com/en-my/article/BETA-DIST-function-11188c9c-780a-42c7-ba43-9ecb5a878d31?ui=en-US&rs=en-MY&ad=MY&fromAR=1) will take at least four arguments.

Solution:

Added argument checks in function BETA.DIST().
More tests are also added.
fiatjaf added a commit to fiatjaf/formula.js that referenced this issue Feb 9, 2016
Fixed issue sutoiku#40: BETADIST function does not work correctly.
jalateras added a commit that referenced this issue Mar 19, 2016
Fixed issue #40: BETADIST function does not work correctly.
@hershenov
Copy link

Is this issue resolved?

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

No branches or pull requests

3 participants