EXPONDIST function
PRO
The EXPONDIST function in Jspreadsheet Formulas Pro returns the exponential distribution, which models the time between independent events that happen at a constant average rate, such as the interval between customer arrivals or the time to failure of a component. It is the compatibility version of EXPON.DIST and returns the same values. The lambda argument is the rate, so a mean waiting time of 10 minutes corresponds to lambda equal to 0.1.
Documentation
Returns the exponential distribution for a specified set of parameters.
Category
Statistical
Syntax
EXPONDIST(x, lambda, cumulative)
| Parameter | Description |
|---|---|
x |
The value at which to evaluate the function. Must be greater than or equal to 0. |
lambda |
The rate parameter of the distribution. Must be greater than 0. |
cumulative |
TRUE returns the cumulative distribution function. FALSE returns the probability density function. |
Behavior
The EXPONDIST function returns lambda * EXP(-lambda * x) when cumulative is FALSE and 1 - EXP(-lambda * x) when it is TRUE.
xmust be 0 or positive andlambdamust be positive. Otherwise the function returns#NUM!.- At
xequal to 0 the density equalslambda, soEXPONDIST(0, 3, FALSE)returns 3. - The cumulative value approaches 1 as
xgrows, which gives the probability that the event happens before timex. - Text arguments return
#VALUE!.
Common Errors
| Error | Description |
|---|---|
| #NUM! | Returned when x is negative or lambda is less than or equal to 0. |
| #VALUE! | Returned when an argument is text that cannot be interpreted as a number. |
Best practices
- Pass
cumulativeexplicitly as TRUE or FALSE so the intent is clear when reading the formula.- Validate the input cells so that
xis never negative andlambdais never zero, since both cases return#NUM!.- Use absolute references for the
lambdacells 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 EXPONDIST function.
EXPONDIST(2, 3, FALSE)
// Returns 0.007436, the density at x = 2
EXPONDIST(2, 3, TRUE)
// Returns 0.997521, the probability that the event happens before x = 2
EXPONDIST(0, 3, FALSE)
// Returns 3, the density at zero equals lambda
EXPONDIST(-1, 3, TRUE)
// Returns #NUM! because x is negative
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('NzQ5YzU2M2Q1MTY3MDY0YzdkYmQzMjliOTEzZTk3NDZjNjhkMDQ2ZmFlMGUzZTkwODZmODYxNjVkYmZkYjI4NmYzOGFhMjljMWJmYmUxZDYxZjc4ZWFkZjM5YWI1ZWVlYmNmMjc3ZjY2YzI3MDIyNzRjZjU4OGJhNTVhZTAwNzgsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpreE9EY3hNRFkzTENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0luWXhNaUlzSW5ZeE15SXNJbU5vWVhKMGN5SXNJbVp2Y20xeklpd2labTl5YlhWc1lTSXNJbkJoY25ObGNpSXNJbkpsYm1SbGNpSXNJbU52YlcxbGJuUnpJaXdpYVcxd2IzSjBaWElpTENKaVlYSWlMQ0oyWVd4cFpHRjBhVzl1Y3lJc0luTmxZWEpqYUNJc0luQnlhVzUwSWl3aWMyaGxaWFJ6SWl3aVkyeHBaVzUwSWl3aWMyVnlkbVZ5SWl3aWMyaGhjR1Z6SWl3aVptOXliV0YwSWl3aWNHbDJiM1FpWFN3aVpHVnRieUk2ZEhKMVpYMD0=');
// Set the extensions
jspreadsheet.setExtensions({ formula });
// Create a new spreadsheet
jspreadsheet(document.getElementById('spreadsheet'), {
worksheets: [{
data: [
[
"x",
"lambda",
"cumulative",
"EXPONDIST"
],
[
0.5,
0.1,
true,
"=EXPONDIST(A2, B2, C2)"
],
[
2,
3,
false,
"=EXPONDIST(A3, B3, C3)"
],
[
2,
3,
true,
"=EXPONDIST(A4, B4, C4)"
],
[
10,
0.1,
true,
"=EXPONDIST(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('NzQ5YzU2M2Q1MTY3MDY0YzdkYmQzMjliOTEzZTk3NDZjNjhkMDQ2ZmFlMGUzZTkwODZmODYxNjVkYmZkYjI4NmYzOGFhMjljMWJmYmUxZDYxZjc4ZWFkZjM5YWI1ZWVlYmNmMjc3ZjY2YzI3MDIyNzRjZjU4OGJhNTVhZTAwNzgsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpreE9EY3hNRFkzTENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0luWXhNaUlzSW5ZeE15SXNJbU5vWVhKMGN5SXNJbVp2Y20xeklpd2labTl5YlhWc1lTSXNJbkJoY25ObGNpSXNJbkpsYm1SbGNpSXNJbU52YlcxbGJuUnpJaXdpYVcxd2IzSjBaWElpTENKaVlYSWlMQ0oyWVd4cFpHRjBhVzl1Y3lJc0luTmxZWEpqYUNJc0luQnlhVzUwSWl3aWMyaGxaWFJ6SWl3aVkyeHBaVzUwSWl3aWMyVnlkbVZ5SWl3aWMyaGhjR1Z6SWl3aVptOXliV0YwSWl3aWNHbDJiM1FpWFN3aVpHVnRieUk2ZEhKMVpYMD0=');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default function App() {
// Spreadsheet array of worksheets
const spreadsheet = useRef();
// Worksheet data
const data = [
[
"x",
"lambda",
"cumulative",
"EXPONDIST"
],
[
0.5,
0.1,
true,
"=EXPONDIST(A2, B2, C2)"
],
[
2,
3,
false,
"=EXPONDIST(A3, B3, C3)"
],
[
2,
3,
true,
"=EXPONDIST(A4, B4, C4)"
],
[
10,
0.1,
true,
"=EXPONDIST(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('NzQ5YzU2M2Q1MTY3MDY0YzdkYmQzMjliOTEzZTk3NDZjNjhkMDQ2ZmFlMGUzZTkwODZmODYxNjVkYmZkYjI4NmYzOGFhMjljMWJmYmUxZDYxZjc4ZWFkZjM5YWI1ZWVlYmNmMjc3ZjY2YzI3MDIyNzRjZjU4OGJhNTVhZTAwNzgsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpreE9EY3hNRFkzTENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0luWXhNaUlzSW5ZeE15SXNJbU5vWVhKMGN5SXNJbVp2Y20xeklpd2labTl5YlhWc1lTSXNJbkJoY25ObGNpSXNJbkpsYm1SbGNpSXNJbU52YlcxbGJuUnpJaXdpYVcxd2IzSjBaWElpTENKaVlYSWlMQ0oyWVd4cFpHRjBhVzl1Y3lJc0luTmxZWEpqYUNJc0luQnlhVzUwSWl3aWMyaGxaWFJ6SWl3aVkyeHBaVzUwSWl3aWMyVnlkbVZ5SWl3aWMyaGhjR1Z6SWl3aVptOXliV0YwSWl3aWNHbDJiM1FpWFN3aVpHVnRieUk2ZEhKMVpYMD0=');
// Set the extensions
jspreadsheet.setExtensions({ formula });
export default {
components: {
Spreadsheet,
Worksheet,
},
data() {
// Worksheet data
const data = [
[
"x",
"lambda",
"cumulative",
"EXPONDIST"
],
[
0.5,
0.1,
true,
"=EXPONDIST(A2, B2, C2)"
],
[
2,
3,
false,
"=EXPONDIST(A3, B3, C3)"
],
[
2,
3,
true,
"=EXPONDIST(A4, B4, C4)"
],
[
10,
0.1,
true,
"=EXPONDIST(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('NzQ5YzU2M2Q1MTY3MDY0YzdkYmQzMjliOTEzZTk3NDZjNjhkMDQ2ZmFlMGUzZTkwODZmODYxNjVkYmZkYjI4NmYzOGFhMjljMWJmYmUxZDYxZjc4ZWFkZjM5YWI1ZWVlYmNmMjc3ZjY2YzI3MDIyNzRjZjU4OGJhNTVhZTAwNzgsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpreE9EY3hNRFkzTENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0p6ZEdGamEySnNhWFI2TG1sdklpd2lkMlZpWTI5dWRHRnBibVZ5TG1sdklpd2liRzlqWVd4b2IzTjBJbDBzSW5Cc1lXNGlPaUl6TkNJc0luTmpiM0JsSWpwYkluWTNJaXdpZGpnaUxDSjJPU0lzSW5ZeE1DSXNJbll4TVNJc0luWXhNaUlzSW5ZeE15SXNJbU5vWVhKMGN5SXNJbVp2Y20xeklpd2labTl5YlhWc1lTSXNJbkJoY25ObGNpSXNJbkpsYm1SbGNpSXNJbU52YlcxbGJuUnpJaXdpYVcxd2IzSjBaWElpTENKaVlYSWlMQ0oyWVd4cFpHRjBhVzl1Y3lJc0luTmxZWEpqYUNJc0luQnlhVzUwSWl3aWMyaGxaWFJ6SWl3aVkyeHBaVzUwSWl3aWMyVnlkbVZ5SWl3aWMyaGhjR1Z6SWl3aVptOXliV0YwSWl3aWNHbDJiM1FpWFN3aVpHVnRieUk2ZEhKMVpYMD0=');
// 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",
"lambda",
"cumulative",
"EXPONDIST"
],
[
0.5,
0.1,
true,
"=EXPONDIST(A2, B2, C2)"
],
[
2,
3,
false,
"=EXPONDIST(A3, B3, C3)"
],
[
2,
3,
true,
"=EXPONDIST(A4, B4, C4)"
],
[
10,
0.1,
true,
"=EXPONDIST(A5, B5, C5)"
]
]
}]
});
}
}