Python Statistical Functions for Excel

Python
Statistics
Excel
Use selected scipy.stats distribution methods in Excel through Python-powered statistical functions, including capabilities beyond native Excel functions.
Published

July 9, 2025

Historical product note (August 2026): This article documents statistical functions from the earlier Example Functions / standalone function-authoring workflow. For current work, start with the reactive notebook product and publish reusable worksheet functions through BF.FUNCTION().

This release added Python-powered statistical functions for Excel based on selected distributions and methods from Python’s scipy.stats library. The wrappers expose useful capabilities such as density/probability functions, cumulative probabilities, quantiles, survival functions, and summary statistics for a set of distributions, including distributions that do not have direct native Excel equivalents. They do not expose the complete scipy.stats API: SciPy distributions also provide capabilities such as random variate generation, fitting, entropy, expectations, moments, and log-domain methods.

Why Use Python Statistical Functions in Excel?

Excel already provides a broad set of statistical functions, but its distribution coverage and available methods differ from SciPy. For the distributions wrapped by these example Python functions, the main additions include:

  • Additional distribution methods such as survival and inverse-survival functions where the corresponding Excel distribution does not expose them directly.
  • Summary statistics such as mean, median, variance, and standard deviation through the wrapper interface.
  • SciPy-style parameterization using location and scale where supported by the selected SciPy distribution.
  • Access to selected distributions without direct Excel distribution-function equivalents, such as Cauchy, Laplace, and Pareto.

These are differences in the selected wrappers, not a claim that they expose every method available in scipy.stats.

Comparison Table: Python vs. Native Excel Functions

Excel Python Function Native Excel Function(s) Key Differences
BETA BETA.DIST, BETA.INV Python adds survival, inverse survival, and wrapper summary statistics. Excel already supports optional lower/upper interval bounds (A, B).
CAUCHY — Not available in Excel; the wrapper provides density, cumulative, quantile, survival, and summary-statistic methods.
CHISQ CHISQ.DIST, CHISQ.INV Python adds survival, inverse survival, wrapper summary statistics, and SciPy-style location/scale parameters.
EXPON EXPON.DIST Python adds quantile, survival, inverse survival, wrapper summary statistics, and SciPy-style location/scale parameters.
F_DIST F.DIST, F.INV Python adds survival, inverse survival, wrapper summary statistics, and SciPy-style location/scale parameters.
GAMMA GAMMA.DIST, GAMMA.INV Python adds survival, inverse survival, wrapper summary statistics, and SciPy-style location/scale parameters.
LAPLACE — Not available in Excel; the wrapper provides density, cumulative, quantile, survival, and summary-statistic methods.
LOGNORM LOGNORM.DIST, LOGNORM.INV Python adds survival, inverse survival, and wrapper summary statistics, but SciPy and Excel use different parameter conventions.
NORM NORM.DIST, NORM.INV Python adds survival, inverse survival, wrapper summary statistics, and SciPy-style location/scale parameters.
PARETO — Not available in Excel; the wrapper provides density, cumulative, quantile, survival, and summary-statistic methods.
T_DIST T.DIST, T.DIST.2T, T.DIST.RT, T.INV, T.INV.2T Python adds survival, inverse survival, wrapper summary statistics, and SciPy-style location/scale parameters.
UNIFORM RAND, RANDBETWEEN Python provides density, cumulative, quantile, survival, and summary-statistic methods not provided by RAND/RANDBETWEEN.
WEIBULL_MIN WEIBULL.DIST Python adds quantile, survival, inverse survival, wrapper summary statistics, and SciPy-style location/scale parameters.

Parameter names are not always directly interchangeable between Excel and SciPy. For example, Excel’s LOGNORM.DIST takes the mean and standard deviation of ln(x). SciPy’s lognorm represents the same common two-parameter lognormal case with s = sigma, loc = 0, and scale = exp(mu).

Legend: - PDF: Probability Density Function - CDF: Cumulative Distribution Function - Quantile: Inverse CDF - Survival: Survival Function (1 - CDF) - Stats: Mean, Median, Variance, Standard Deviation

Example: Using Python Functions in Excel

Suppose you want to compute the inverse CDF (quantile) for the Weibull distribution, which is not available in native Excel. With the new Python function, you can simply use:

=WEIBULL_MIN(0.95, 1.5, 0, 1, "icdf")

Similarly, for distributions not available in Excel at all (like Pareto or Cauchy), you can now perform advanced statistical analysis directly in your spreadsheet.

Getting Started

To use these functions, add them from the list of Example Functions in our Python for Excel add-in. Then, simply call the functions as you would any Excel formula.

You can see the full list of available functions in our Python Functions Repository.

Excel Statistical Functions

Function Description
AVEDEV Returns the average of the absolute deviations of data points from their mean
AVERAGE Returns the average of its arguments
AVERAGEA Returns the average of its arguments, including numbers, text, and logical values
AVERAGEIF Returns the average (arithmetic mean) of all the cells in a range that meet a given criteria
AVERAGEIFS Returns the average (arithmetic mean) of all cells that meet multiple criteria
BETA.DIST Returns the beta cumulative distribution function
BETA.INV Returns the inverse of the cumulative distribution function for a specified beta distribution
BINOM.DIST Returns the individual term binomial distribution probability
BINOM.DIST.RANGE Returns the probability of a trial result using a binomial distribution
BINOM.INV Returns the smallest value for which the cumulative binomial distribution is less than or equal to a criterion value
CHISQ.DIST Returns the chi-squared distribution
CHISQ.DIST.RT Returns the one-tailed probability of the chi-squared distribution
CHISQ.INV Returns the inverse of the left-tailed probability of the chi-squared distribution
CHISQ.INV.RT Returns the inverse of the one-tailed probability of the chi-squared distribution
CHISQ.TEST Returns the test for independence
CONFIDENCE.NORM Returns the confidence interval for a population mean
CONFIDENCE.T Returns the confidence interval for a population mean, using a Student’s t distribution
CORREL Returns the correlation coefficient between two data sets
COUNT Counts how many numbers are in the list of arguments
COUNTA Counts how many values are in the list of arguments
COUNTBLANK Counts the number of blank cells within a range
COUNTIF Counts the number of cells within a range that meet the given criteria
COUNTIFS Counts the number of cells within a range that meet multiple criteria
COVARIANCE.P Returns covariance, the average of the products of paired deviations
COVARIANCE.S Returns the sample covariance, the average of the products deviations for each data point pair in two data sets
DEVSQ Returns the sum of squares of deviations
EXPON.DIST Returns the exponential distribution
F.DIST Returns the F probability distribution
F.DIST.RT Returns the F probability distribution
F.INV Returns the inverse of the F probability distribution
F.INV.RT Returns the inverse of the F probability distribution
F.TEST Returns the result of an F-test
FISHER Returns the Fisher transformation
FISHERINV Returns the inverse of the Fisher transformation
FORECAST Returns a value along a linear trend
FORECAST.ETS Returns a future value based on existing (historical) values by using the AAA version of the Exponential Smoothing (ETS) algorithm
FORECAST.ETS.CONFINT Returns a confidence interval for the forecast value at the specified target date
FORECAST.ETS.SEASONALITY Returns the length of the repetitive pattern Excel detects for the specified time series
FORECAST.ETS.STAT Returns a statistical value as a result of time series forecasting
FORECAST.LINEAR Returns a future value based on existing values
FREQUENCY Returns a frequency distribution as a vertical array
GAMMA Returns the gamma function value
GAMMA.DIST Returns the gamma distribution
GAMMA.INV Returns the inverse of the gamma cumulative distribution
GAMMALN Returns the natural logarithm of the gamma function, Γ(x)
GAMMALN.PRECISE Returns the natural logarithm of the gamma function, Γ(x)
GAUSS Returns 0.5 less than the standard normal cumulative distribution
GEOMEAN Returns the geometric mean
GROWTH Returns values along an exponential trend
HARMEAN Returns the harmonic mean
HYPGEOM.DIST Returns the hypergeometric distribution
INTERCEPT Returns the intercept of the linear regression line
KURT Returns the kurtosis of a data set
LARGE Returns the k-th largest value in a data set
LINEST Returns the parameters of a linear trend
LOGEST Returns the parameters of an exponential trend
LOGNORM.DIST Returns the cumulative lognormal distribution
LOGNORM.INV Returns the inverse of the lognormal cumulative distribution
MAX Returns the maximum value in a list of arguments
MAXA Returns the maximum value in a list of arguments, including numbers, text, and logical values
MAXIFS Returns the maximum value among cells specified by a given set of conditions or criteria
MEDIAN Returns the median of the given numbers
MIN Returns the minimum value in a list of arguments
MINIFS Returns the minimum value among cells specified by a given set of conditions or criteria.
MINA Returns the smallest value in a list of arguments, including numbers, text, and logical values
MODE.MULT Returns a vertical array of the most frequently occurring, or repetitive values in an array or range of data
MODE.SNGL Returns the most common value in a data set
NEGBINOM.DIST Returns the negative binomial distribution
NORM.DIST Returns the normal cumulative distribution
NORM.INV Returns the inverse of the normal cumulative distribution
NORM.S.DIST Returns the standard normal cumulative distribution
NORM.S.INV Returns the inverse of the standard normal cumulative distribution
PEARSON Returns the Pearson product moment correlation coefficient
PERCENTILE.EXC Returns the k-th percentile of values in a range, where k is in the range 0 to 1, exclusive.
PERCENTILE.INC Returns the k-th percentile of values in a range
PERCENTRANK.EXC Returns the rank of a value in a data set as a percentage (0 to 1, exclusive) of the data set
PERCENTRANK.INC Returns the percentage rank of a value in a data set
PERMUT Returns the number of permutations for a given number of objects
PERMUTATIONA Returns the number of permutations for a given number of objects (with repetitions) that can be selected from the total objects
PHI Returns the value of the density function for a standard normal distribution
POISSON.DIST Returns the Poisson distribution
PROB Returns the probability that values in a range are between two limits
QUARTILE.EXC Returns the quartile of the data set, based on percentile values from 0 to 1, exclusive
QUARTILE.INC Returns the quartile of a data set
RANK.AVG Returns the rank of a number in a list of numbers
RANK.EQ Returns the rank of a number in a list of numbers
RSQ Returns the square of the Pearson product moment correlation coefficient
SKEW Returns the skewness of a distribution
SKEW.P Returns the skewness of a distribution based on a population: a characterization of the degree of asymmetry of a distribution around its mean
SLOPE Returns the slope of the linear regression line
SMALL Returns the k-th smallest value in a data set
STANDARDIZE Returns a normalized value
STDEV.P Calculates standard deviation based on the entire population
STDEV.S Estimates standard deviation based on a sample
STDEVA Estimates standard deviation based on a sample, including numbers, text, and logical values
STDEVPA Calculates standard deviation based on the entire population, including numbers, text, and logical values
STEYX Returns the standard error of the predicted y-value for each x in the regression
T.DIST Returns the Percentage Points (probability) for the Student t-distribution
T.DIST.2T Returns the Percentage Points (probability) for the Student t-distribution
T.DIST.RT Returns the Student’s t-distribution
T.INV Returns the t-value of the Student’s t-distribution as a function of the probability and the degrees of freedom
T.INV.2T Returns the inverse of the Student’s t-distribution
T.TEST Returns the probability associated with a Student’s t-test
TREND Returns values along a linear trend
TRIMMEAN Returns the mean of the interior of a data set
VAR.P Calculates variance based on the entire population
VAR.S Estimates variance based on a sample
VARA Estimates variance based on a sample, including numbers, text, and logical values
VARPA Calculates variance based on the entire population, including numbers, text, and logical values
WEIBULL.DIST Returns the Weibull distribution
Z.TEST Returns the one-tailed probability-value of a z-test