BETADIST function
PRO
The BETADIST function in Jspreadsheet Formulas Pro returns the cumulative beta probability for a value between a lower and an upper bound. It is the compatibility version of BETA.DIST: it always returns the cumulative distribution and has no cumulative argument. The beta distribution is commonly used to model proportions and percentages, such as the completion rate of a task or the share of a population that satisfies a condition.
Documentation
Returns the cumulative beta probability density function.
Category
Statistical
Syntax
BETADIST(x, alpha, beta, [A], [B])
| Parameter | Description |
|---|---|
x |
The value at which to evaluate the function, between A and B. |
alpha |
The first shape parameter of the distribution. Must be greater than 0. |
beta |
The second shape parameter of the distribution. Must be greater than 0. |
[A] |
Optional. The lower bound of the interval of x. Defaults to 0. |
[B] |
Optional. The upper bound of the interval of x. Defaults to 1. |
Behavior
The BETADIST function returns the probability that a beta-distributed variable is less than or equal to x. It produces the same value as BETA.DIST with cumulative set to TRUE.
xmust be inside the interval[A, B]. Values outside the interval return#NUM!.alphaandbetamust be greater than 0.- When
AandBare omitted the standard interval from 0 to 1 is used. - Only the cumulative distribution is available. Use
BETA.DISTwithcumulativeFALSE to get the probability density. - Text arguments return
#VALUE!instead of being converted.
Common Errors
| Error | Description |
|---|---|
| #NUM! | Returned when alpha or beta is less than or equal to 0, or when x is outside the interval defined by A and B. |
| #VALUE! | Returned when an argument is text that cannot be interpreted as a number. |
Best practices
- Make sure
xstays inside the interval defined byAandB, or wrap the call withIFERRORto handle#NUM!whenxcomes from data.- Reference
alphaandbetafrom cells validated to be greater than 0, since zero or negative values return#NUM!.- Use absolute references for the
alphaandbetacells when copying the formula down a column ofxvalues, for example$B$1.- Check with
ISNUMBERthat the input cells hold numbers, because text returns#VALUE!.
Usage
A few examples using the BETADIST function.
BETADIST(0.2, 2, 3)
// Returns 0.1808
BETADIST(0.8, 4, 2, 0.5, 1)
// Returns 0.33696, using the interval from 0.5 to 1
BETADIST(0.5, 1, 1)
// Returns 0.5, the uniform case
BETADIST(2, 2, 3)
// Returns #NUM! because x is outside the interval from 0 to 1
Interactive Spreadsheet Demo
<html>
<script src="https://jsuites.net/v6/jsuites.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jspreadsheet@13/dist/index.min.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v6/jsuites.css" type="text/css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jspreadsheet@13/dist/jspreadsheet.min.css" type="text/css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />
<script src="https://cdn.jsdelivr.net/npm/@jspreadsheet/formula-pro/dist/index.min.js"></script>
<div id="spreadsheet"></div>
<script>
// You can use the following license for quick testing on localhost, StackBlitz, or CodeSandbox.
// The license is valid for one day, after which the spreadsheet will become read-only.
// For a longer trial period, you can create a free account and generate a demo license with an extended expiration date.
jspreadsheet.setLicense('ZTgwZWZmZDA4ZjY3NWRhYmIxMjMyZTk1N2QwNWFkMDFmYzkwZmQzMTAzMDdjN2RhZGM2NzdhMjExYTJiMDg4NGRiMTIwMDI1YmFmNTY3MWI1NDIwOTAxOTZjZjJlZTcxMGQyYzk0ZjNhYWQzOGIyYTQyNmQ0YmNkNzk1Y2I3OTIsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpreE1UYzFOVFU1TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0luWXhNaUlzSW5ZeE15SXNJbU5vWVhKMGN5SXNJbVp2Y20xeklpd2labTl5YlhWc1lTSXNJbkJoY25ObGNpSXNJbkpsYm1SbGNpSXNJbU52YlcxbGJuUnpJaXdpYVcxd2IzSjBaWElpTENKaVlYSWlMQ0oyWVd4cFpHRjBhVzl1Y3lJc0luTmxZWEpqYUNJc0luQnlhVzUwSWl3aWMyaGxaWFJ6SWl3aVkyeHBaVzUwSWl3aWMyVnlkbVZ5SWl3aWMyaGhjR1Z6SWl3aVptOXliV0YwSWl3aWNHbDJiM1FpWFN3aVpHVnRieUk2ZEhKMVpYMD0=');
// Set the extensions
jspreadsheet.setExtensions({ formula });
// Create a new spreadsheet
jspreadsheet(document.getElementById('spreadsheet'), {
worksheets: [{
data: [
[
"x",
"alpha",
"beta",
"BETADIST"
],
[
0.2,
2,
3,
"=BETADIST(A2, B2, C2)"
],
[
0.5,
2,
3,
"=BETADIST(A3, B3, C3)"
],
[
0.8,
2,
3,
"=BETADIST(A4, B4, C4)"
],
[
0.5,
1,
1,
"=BETADIST(A5, B5, C5)"
]
]
}]
});
</script>
</html>
import React, { useRef } from "react";
import { Spreadsheet, Worksheet, jspreadsheet } from "@jspreadsheet/react";
import formula from "@jspreadsheet/formula-pro";
import "jsuites/dist/jsuites.css";
import "jspreadsheet/dist/jspreadsheet.css";
// Set license
jspreadsheet.setLicense('ZTgwZWZmZDA4ZjY3NWRhYmIxMjMyZTk1N2QwNWFkMDFmYzkwZmQzMTAzMDdjN2RhZGM2NzdhMjExYTJiMDg4NGRiMTIwMDI1YmFmNTY3MWI1NDIwOTAxOTZjZjJlZTcxMGQyYzk0ZjNhYWQzOGIyYTQyNmQ0YmNkNzk1Y2I3OTIsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpreE1UYzFOVFU1TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0luWXhNaUlzSW5ZeE15SXNJbU5vWVhKMGN5SXNJbVp2Y20xeklpd2labTl5YlhWc1lTSXNJbkJoY25ObGNpSXNJbkpsYm1SbGNpSXNJbU52YlcxbGJuUnpJaXdpYVcxd2IzSjBaWElpTENKaVlYSWlMQ0oyWVd4cFpHRjBhVzl1Y3lJc0luTmxZWEpqYUNJc0luQnlhVzUwSWl3aWMyaGxaWFJ6SWl3aVkyeHBaVzUwSWl3aWMyVnlkbVZ5SWl3aWMyaGhjR1Z6SWl3aVptOXliV0YwSWl3aWNHbDJiM1FpWFN3aVpHVnRieUk2ZEhKMVpYMD0=');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default function App() {
// Spreadsheet array of worksheets
const spreadsheet = useRef();
// Worksheet data
const data = [
[
"x",
"alpha",
"beta",
"BETADIST"
],
[
0.2,
2,
3,
"=BETADIST(A2, B2, C2)"
],
[
0.5,
2,
3,
"=BETADIST(A3, B3, C3)"
],
[
0.8,
2,
3,
"=BETADIST(A4, B4, C4)"
],
[
0.5,
1,
1,
"=BETADIST(A5, B5, C5)"
]
];
// Render component
return (
<Spreadsheet ref={spreadsheet}>
<Worksheet data={data} />
</Spreadsheet>
);
}
<template>
<Spreadsheet ref="spreadsheet">
<Worksheet :data="data" />
</Spreadsheet>
</template>
<script>
import { Spreadsheet, Worksheet, jspreadsheet } from "@jspreadsheet/vue";
import "jsuites/dist/jsuites.css";
import "jspreadsheet/dist/jspreadsheet.css";
import formula from "@jspreadsheet/formula-pro";
// Set license
jspreadsheet.setLicense('ZTgwZWZmZDA4ZjY3NWRhYmIxMjMyZTk1N2QwNWFkMDFmYzkwZmQzMTAzMDdjN2RhZGM2NzdhMjExYTJiMDg4NGRiMTIwMDI1YmFmNTY3MWI1NDIwOTAxOTZjZjJlZTcxMGQyYzk0ZjNhYWQzOGIyYTQyNmQ0YmNkNzk1Y2I3OTIsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpreE1UYzFOVFU1TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0luWXhNaUlzSW5ZeE15SXNJbU5vWVhKMGN5SXNJbVp2Y20xeklpd2labTl5YlhWc1lTSXNJbkJoY25ObGNpSXNJbkpsYm1SbGNpSXNJbU52YlcxbGJuUnpJaXdpYVcxd2IzSjBaWElpTENKaVlYSWlMQ0oyWVd4cFpHRjBhVzl1Y3lJc0luTmxZWEpqYUNJc0luQnlhVzUwSWl3aWMyaGxaWFJ6SWl3aVkyeHBaVzUwSWl3aWMyVnlkbVZ5SWl3aWMyaGhjR1Z6SWl3aVptOXliV0YwSWl3aWNHbDJiM1FpWFN3aVpHVnRieUk2ZEhKMVpYMD0=');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default {
components: {
Spreadsheet,
Worksheet,
},
data() {
// Worksheet data
const data = [
[
"x",
"alpha",
"beta",
"BETADIST"
],
[
0.2,
2,
3,
"=BETADIST(A2, B2, C2)"
],
[
0.5,
2,
3,
"=BETADIST(A3, B3, C3)"
],
[
0.8,
2,
3,
"=BETADIST(A4, B4, C4)"
],
[
0.5,
1,
1,
"=BETADIST(A5, B5, C5)"
]
]
return {
data
};
}
}
</script>
import { Component, ViewChild, ElementRef } from "@angular/core";
import jspreadsheet from "jspreadsheet";
import formula from "@jspreadsheet/formula-pro";
// You can use the following license for quick testing on localhost, StackBlitz, or CodeSandbox.
// The license is valid for one day, after which the spreadsheet will become read-only.
// For a longer trial period, you can create a free account and generate a demo license with an extended expiration date.
jspreadsheet.setLicense('ZTgwZWZmZDA4ZjY3NWRhYmIxMjMyZTk1N2QwNWFkMDFmYzkwZmQzMTAzMDdjN2RhZGM2NzdhMjExYTJiMDg4NGRiMTIwMDI1YmFmNTY3MWI1NDIwOTAxOTZjZjJlZTcxMGQyYzk0ZjNhYWQzOGIyYTQyNmQ0YmNkNzk1Y2I3OTIsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpreE1UYzFOVFU1TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0luWXhNaUlzSW5ZeE15SXNJbU5vWVhKMGN5SXNJbVp2Y20xeklpd2labTl5YlhWc1lTSXNJbkJoY25ObGNpSXNJbkpsYm1SbGNpSXNJbU52YlcxbGJuUnpJaXdpYVcxd2IzSjBaWElpTENKaVlYSWlMQ0oyWVd4cFpHRjBhVzl1Y3lJc0luTmxZWEpqYUNJc0luQnlhVzUwSWl3aWMyaGxaWFJ6SWl3aVkyeHBaVzUwSWl3aWMyVnlkbVZ5SWl3aWMyaGhjR1Z6SWl3aVptOXliV0YwSWl3aWNHbDJiM1FpWFN3aVpHVnRieUk2ZEhKMVpYMD0=');
// Set the extensions
jspreadsheet.setExtensions({ formula });
@Component({
standalone: true,
selector: "app-root",
template: `<div #spreadsheet></div>`
})
export class AppComponent {
@ViewChild("spreadsheet") spreadsheet: ElementRef;
// Worksheets
worksheets: jspreadsheet.worksheetInstance[];
// Create a new data grid
ngAfterViewInit() {
// Create spreadsheet
this.worksheets = jspreadsheet(this.spreadsheet.nativeElement, {
worksheets: [{
data: [
[
"x",
"alpha",
"beta",
"BETADIST"
],
[
0.2,
2,
3,
"=BETADIST(A2, B2, C2)"
],
[
0.5,
2,
3,
"=BETADIST(A3, B3, C3)"
],
[
0.8,
2,
3,
"=BETADIST(A4, B4, C4)"
],
[
0.5,
1,
1,
"=BETADIST(A5, B5, C5)"
]
]
}]
});
}
}