---
title: "Excel functions useful in risk modeling"
canonical: "https://modelassist.epixanalytics.com/space/EA/26575570/Excel%20functions%20useful%20in%20risk%20modeling"
format: markdown
---
Arrays are shown in curly brackets {.,.,.}. They must be input as a list, e.g. {1,2,3..} or a range name, or an array reference e.g. A1:A4.

Note that many of the statistical functions below are written for compatibility with earlier versions of EXCEL. For example, NORMDIST() is now NORM.DIST(). The arguments are for the most part the same and both versions of the formula exist in the newer versions of EXCEL, but it's better to use the latest versions (i.e. with a period in the formula name) as they are more accurate.

### Descriptive Statistics

These functions provide basic statistical values for data sets and are useful for analyzing data, or the exported results of simulations.

### > Macro (anchor)



<details>
<summary>AVEDEV</summary>

<span style="color: #000000">AVEDEV({x}) returns the </span>[average deviation](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575505)<span style="color: #000000"> of a data set</span>
</details>

> Macro (anchor)



<details>
<summary>AVERAGE</summary>

<span style="color: #000000">AVERAGE({x}) returns the mean of a data set</span>
</details>

> Macro (anchor)



<details>
<summary>COMBIN</summary>

<span style="color: #000000">COMBIN(n,x) returns the </span>[binomial coefficient](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574954)  


![image354.gif](media://da80315b-0e50-4ad2-b649-b743ceab90e0)
</details>

> Macro (anchor)



<details>
<summary>CORREL</summary>

<span style="color: #000000">CORREL({x},{y}) returns the </span>[product moment correlation coefficient](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575619#Sumofanumberofdependentrandomvariables-product_moment_correlation_coefficient)<span style="color: #000000"> between data sets {x} and {y}.</span>
</details>

> Macro (anchor)



<details>
<summary>COVAR</summary>

<span style="color: #000000">COVAR({x},{y}) returns the </span>[covariance](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575619#Sumofanumberofdependentrandomvariables-product_moment_correlation_coefficient)<span style="color: #000000"> between data sets {x} and {y}.</span>
</details>

> Macro (anchor)



<details>
<summary>FREQUENCY</summary>

<span style="color: #000000">FREQUENCY({x},{bins}) is an </span>[array function](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26576887)<span style="color: #000000"> that counts the number of data points in the data set {x} that are in each bin. You have to be careful of how the function behaves at the ends of the bin array.</span>
</details>

> Macro (anchor)



<details>
<summary>KURT</summary>

<span style="color: #000000">KURT({x}) + 3 returns the </span>[kurtosis](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575509)<span style="color: #000000"> of a data set</span>
</details>

> Macro (anchor)



<details>
<summary>MAX</summary>

<span style="color: #000000">MAX({x}) returns the maximum of a data set</span>
</details>

> Macro (anchor)



<details>
<summary>MEDIAN</summary>

<span style="color: #000000">MEDIAN({x}) returns the </span>[median](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575495)<span style="color: #000000"> of a data set</span>
</details>

> Macro (anchor)



<details>
<summary>MIN</summary>

<span style="color: #000000">MIN({x}) returns the minimum of a data set</span>
</details>

> Macro (anchor)



<details>
<summary>MULTINOMIAL</summary>

<span style="color: #000000">MULTINOMIAL({s}) returns the </span>[multinomial coefficient](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575636#Multivariatetrials-Multinomial_coefficient)<span style="color: #000000">  </span>  


![image355.gif](media://160dd4c3-2eee-4788-a926-b0579b311814)

  
<span style="color: #000000">for which the binomial coefficient COMBIN is a special case.</span>
</details>

> Macro (anchor)



<details>
<summary>PERCENTILE</summary>

<span style="color: #000000">PERCENTILE(array,k) returns the k-th percentile of values in a range. You can use this function to establish a threshold of acceptance. For example, you can decide to examine candidates who score above the 90th percentile.</span>
</details>

> Macro (anchor)



<details>
<summary>RANK</summary>

<span style="color: #000000">Rank =RANK(x,array,order) order: 0=descending; 1=ascending</span>
</details>

> Macro (anchor)



<details>
<summary>SKEW</summary>

<span style="color: #000000">SKEW({x}) returns the </span>[skewness](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575508)<span style="color: #000000"> of a data set</span>
</details>

> Macro (anchor)



<details>
<summary>STDEV</summary>

<span style="color: #000000">STDEV({x}) returns the </span>[standard deviation](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574927)<span style="color: #000000"> of a data set</span>
</details>

> Macro (anchor)



<details>
<summary>VAR</summary>

<span style="color: #000000">VAR({x}) returns the </span>[variance](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574926)<span style="color: #000000"> of a data set</span>
</details>

  


### Distributions

Returns a value (given the probability) or a probability (give the value) from a probability distribution, NOT a random value like Crystal Ball distributions. The parameter cumulative allows you to control whether the returned probability is from the [probability mass](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574887/) (or [probability density curve](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574888/)), or from the [cumulative probability curve](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574886/).

  


> Macro (anchor)



<details>
<summary>BETADIST</summary>

<span style="color: #000000">BETADIST(x,</span><span style="color: #000000">*a,b*</span><span style="color: #000000">,</span><span style="color: #000000">*min,max*</span><span style="color: #000000">) returns the cumulative probability of x from the </span>[Beta(](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575217)*[a, b](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575217)*[)](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575217)<span style="color: #000000"> distribution. If the min and max optional parameters are used, it rescales the beta distribution.</span>
</details>

> Macro (anchor)



<details>
<summary>BETAINV</summary>

<span style="color: #000000">BETAINV(P,</span><span style="color: #000000">*a,b*</span><span style="color: #000000">,</span><span style="color: #000000">*min,max*</span><span style="color: #000000">) returns the </span>[cumulative percentile](https://modelassist.epixanalytics.com/wiki/spaces/EA/pages/26574886)<span style="color: #000000"> xP from a Beta(</span><span style="color: #000000">*a,b*</span><span style="color: #000000">) distribution. If the min and max optional parameters are used, it rescales the beta distribution.</span>
</details>

> Macro (anchor)



<details>
<summary>BINOMDIST</summary>

<span style="color: #000000">BINOMDIST(x,n,p,cumulative) returns the probabilities of x from the </span>[Binomial(n,p)](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575204)<span style="color: #000000"> distribution.</span>
</details>

> Macro (anchor)



<details>
<summary>CHIDIST</summary>

<span style="color: #000000">CHIDIST(x,</span><span style="color: #000000">*n*</span><span style="color: #000000">) returns the </span>[cumulative probability](https://modelassist.epixanalytics.com/wiki/spaces/EA/pages/26574886)<span style="color: #000000"> from a </span>[Chisq(](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575221)*[n](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575221)*[)](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575221)<span style="color: #000000"> distribution.</span>
</details>

> Macro (anchor)



<details>
<summary>CHIINV</summary>

<span style="color: #000000">CHIINV(P,</span><span style="color: #000000">*n*</span><span style="color: #000000">) returns the </span>[cumulative percentile](https://modelassist.epixanalytics.com/wiki/spaces/EA/pages/26574886)<span style="color: #000000"> xP from a </span>[Chisq(](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575221/)*[n](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575221/)*[)](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575221)<span style="color: #000000">  distribution.</span>
</details>

> Macro (anchor)



<details>
<summary>EXPONDIST</summary>

<span style="color: #000000">EXPONDIST(x,</span><span style="color: #000000">*l*</span><span style="color: #000000">,cumulative) returns the probabilities of x from the </span>[Expon(](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575227)*[b](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575227)*[)](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575227)<span style="color: #000000"> distribution where </span><span style="color: #000000">*l*</span><span style="color: #000000"> = 1/</span><span style="color: #000000">*b*</span><span style="color: #000000">. (the departure from standard convention for the parameter can be confusing, and is inconsistent with the GAMMADIST function, so be careful)</span>
</details>

> Macro (anchor)

  


<details>
<summary>FDIST</summary>

FDIST(x, *n*1*,n*2) returns the [cumulative probability](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574886/) from an [F(](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575229/)*[n1,n](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575229/)*[2)](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575229/) distribution.
</details>

> Macro (anchor)



<details>
<summary>FINV</summary>

FINV(P, *n*1*,n*2) returns the [cumulative percentile](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574886/) xP from an [F(](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575229/)*[n1,n](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575229/)*[2)](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575229/) distribution.
</details>

> Macro (anchor)



<details>
<summary>GAMMADIST</summary>

GAMMADIST(x,*a,b*,cumulative) returns the probabilities of x from the [Gamma(](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575231/)*[a,b](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575231/)*[)](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575231) distribution.
</details>

> Macro (anchor)



<details>
<summary>HYPGEOMDIST</summary>

HYPGEOMDIST(x,n,D,M) returns the probability mass of x from the [Hypergeometric(n,D,M)](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575208/) distribution.
</details>

> Macro (anchor)



<details>
<summary>LOGINV</summary>

LOGINV(P,*m,s*) returns the [cumulative percentile](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574886/) xP from a [Lognorm2(](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575245/)*[m,s](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575245/)*[)](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575245/) distribution (i.e. the mean and standard deviation apply to the corresponding Normal distribution.
</details>

> Macro (anchor)



<details>
<summary>LOGNORMDIST</summary>

LOGNORMDIST(x,*m,s*) returns the [cumulative probability](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574886/) from a [Lognorm2(](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575245/)*[m,s](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575245/)*[)](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575245/) distribution (i.e. the mean and standard deviation apply to the corresponding Normal distribution.
</details>

> Macro (anchor)



<details>
<summary>NEGBINOMDIST</summary>

NEGBINOMDIST(x,s,p) returns the probabilities of x from the [Negative Binomial(s,p)](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575213/) distribution.
</details>

> Macro (anchor)



<details>
<summary>NORMDIST</summary>

NORMDIST(x,*m,s*,cumulative) returns the probabilities of x from the [Normal(](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575246/)*[m,s](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575246/)*[)](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575246/) distribution.
</details>

> Macro (anchor)



<details>
<summary>NORMINV</summary>

NORMINV(P,*m,s*) returns the [cumulative percentile](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574886/) xP from the [Normal(](https://modelassist.epixanalytics.com/space/EA/26575246/Normal)*[m,s](https://modelassist.epixanalytics.com/space/EA/26575246/Normal)*[)](https://modelassist.epixanalytics.com/space/EA/26575246/Normal) distribution.
</details>

> Macro (anchor)



<details>
<summary>NORMSDIST</summary>

NORMSDIST(x) returns the [cumulative probability](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574886/) of x for the standard [Normal distribution](https://modelassist.epixanalytics.com/space/EA/26575246/Normal) Normal(0,1). x is equivalent to the z-score in classical statistics.
</details>

> Macro (anchor)



<details>
<summary>  NORMSINV</summary>

NORMSINV(P) returns the cumulative percentile xP from a standard [Normal distribution](https://modelassist.epixanalytics.com/space/EA/26575246/Normal) Normal(0,1).
</details>

> Macro (anchor)



<details>
<summary>POISSON</summary>

POISSON(x,*l*, cumulative) returns the probabilities of x from the [Poisson(](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575214/)*[l](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575214/)*[)](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575214/) distribution.
</details>

> Macro (anchor)



<details>
<summary>TDIST</summary>

Returns the Percentage Points (probability) for the Student t-distribution where a numeric value (x) is a calculated value of t for which the Percentage Points are to be computed. The t-distribution is used in the hypothesis testing of small sample data sets.
</details>

> Macro (anchor)



<details>
<summary>WEIBULL</summary>

WEIBULL(x,*a,b*,cumulative) returns the probabilities of x from a [Weibull(](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575257/)*[a,b](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575257/)*[)](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575257/) distribution.
</details>

  


### Least Squares Regression

These functions return statistical parameters or projections from a [least squares regression](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574959/) that attempts to fit an equation that relates the independent variable X to the dependent variable Y as follows:

  


Y = Normal(m*X+c,Syx)

  


The {x} [array](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26576887) is the set of observations for independent variable X, and the {y} array is the set of observations for the dependent variable Y

> Macro (anchor)



<details>
<summary>FORECAST</summary>

See TREND
</details>

> Macro (anchor)



<details>
<summary>INTERCEPT</summary>

INTERCEPT({y},{x}) returns the estimated c
</details>

> Macro (anchor)



<details>
<summary>RSQ</summary>

RSQ({y},{x}) returns the square (r2) of [Pearsons product moment correlation coefficient r](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575619/).
</details>

> Macro (anchor)



<details>
<summary>SLOPE</summary>

SLOPE({y},{x}) returns the estimated m
</details>

> Macro (anchor)



<details>
<summary>STEYX</summary>

TREND({y},{x},new-xs,constant) returns an array of y-values corresponding to the new x-values, after attempting a regression fit on {y}, {x}. For example:

![image356.gif](media://f0f41387-5637-4afb-902b-d200d03d8570)

The Excel function FORECAST serves the same purpose.
</details>

  


### General

These functions perform basic operations on cells, look up values in data tables, and perform logical tests which are the basic building blocks of risk analysis modeling.

> Macro (anchor)



<details>
<summary>ABS</summary>

ABS(x) returns the absolute value of x, so:

ABS(-4) = 4, ABS(4) = 4.
</details>

> Macro (anchor)



<details>
<summary>AND</summary>

AND(condition1, condition2,&) returns a TRUE if al conditions are met, and a false otherwise. For example:

  


A1: 10

A2: 12

A3: 6

  


=AND(A1>=10, A3>2*A1,A2>=2*A3) returns a TRUE

=AND(A1>=10, A3>2*A1,A2>2*A3) returns a FALSE
</details>

> Macro (anchor)



<details>
<summary>CONCATENATE </summary>

CONCATENATE (text1,text2,...) joins several text strings into one text string.
</details>

> Macro (anchor)



<details>
<summary>COUNT</summary>

COUNT({x}) counts the number of cells that contain numbers and also numbers within the list of arguments. Use COUNT to get the number of entries in a number field that's in a range or array of numbers.
</details>

> Macro (anchor)



<details>
<summary>COUNTIF</summary>

COUNTIF({x},criterion) counts how many cells in the range that {x} satisfy the criterion.
</details>

> Macro (anchor)



<details>
<summary>EXP</summary>

EXP(x) returns the natural exponent of x, i.e. e<sup>x</sup>.
</details>

> Macro (anchor)



<details>
<summary>FACT</summary>

FACT(x) returns the factorial of x, i.e. 1*2*&*x. For example:

FACT(4) = 12

FACT(1) = 1

FACT(0) = 1 That might surprise you its a strange result that comes from the gamma function definition of a factorial:

  


FACT rounds x to the nearest value, but mathematically you can have a factorial of any positive real number. If you want the factorial of say 3.3, you can write:

  


= EXP(GAMMALN(3.3+1)) = EXP(GAMMALN(4.3))

  


For any non-negative integer:

  


FACT(x) = EXP(GAMMALN(x+1))
</details>

> Macro (anchor)



<details>
<summary>FALSE</summary>

FALSE( ) returns the logical value FALSE.
</details>

> Macro (anchor)



<details>
<summary>GAMMALN</summary>

GAMMALN(x) returns the log of the gamma function of x. Actually, this IS useful though rather esoteric, as several probability distributions contain a gamma function. It is also an alternative to calculating very large factorial:

  


= GAMMALN(n+1)

  


So this function is closely related to Excels FACT function.
</details>

> Macro (anchor)



<details>
<summary>HLOOKUP</summary>

HLOOKUP(v,A,i) looks up in a table delineated by the area A. It searches for the value v in the first row, and then returns the value in the ith row of the same column. For example:


![image357.gif](media://cb75dc01-7bf9-4624-8e75-522cc799f857)

   


This is a useful function in combination with a probability distribution for selecting random or conditional values from tables. However, it can be somewhat tricky in predicting what it will do at the end of tables, and wont work properly unless the first column is put in ascending order. For these reasons we tend to use the functions OFFSET and INDEX for this purpose.
</details>

> Macro (anchor)



<details>
<summary>IF</summary>

IF(condition,A,B) returns the value A if the condition is true, and the value B otherwise. For example:

  


A1: 10

A2: 12

A3: 6

  


=IF(A1>0,2,5) returns a 2

=IF(OR(A1>10, A3>A1,A2>=2*A3),1,0) returns a 1

=IF(AND(A1>=10, A3>2*A1,A2>2*A3),1,NA()) returns #N/A

  


This function is extremely useful for creating conditional links between random variables so that a model remains internally consistent no matter what values are being generated from the input distributions.
</details>

> Macro (anchor)



<details>
<summary>INDEX</summary>

INDEX(array,r,c) returns the value in the rth row and the cth column of the specified array. Very useful for picking up values from tables of data when r,c or both are random variables. There is also another parameter format for INDEX.
</details>

> Macro (anchor)



<details>
<summary>ISNA</summary>

ISNA(ref) checks whether a value is #N/A, and returns TRUE or FALSE.
</details>

> Macro (anchor)



<details>
<summary>LN</summary>

LN(x) returns the natural log of x, so LN(EXP(x)) = x
</details>

> Macro (anchor)



<details>
<summary>LOG</summary>

LOG(x, base) returns the logarithm of x to the specified base. The base is taken as 10 if the optional parameter base is omitted, so a<sub>LOG(x,a)</sub> = x.
</details>

> Macro (anchor)



<details>
<summary>LOG10</summary>

LOG10(x) returns the logarithm of x to base 10, so 10<sup>LOG10(x)</sup> = x
</details>

> Macro (anchor)



<details>
<summary>NA</summary>

NA() returns the error #N/A which is useful for [tracking dependent cells](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575522/), and for excluding certain results from a simulation ([see example](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575400/)).
</details>

> Macro (anchor)



<details>
<summary>OFFSET</summary>

OFFSET(reference, r,c,w,h) returns the value r rows below and c columns to the right of reference. If the optional parameters w and h are used, it becomes an array formula and returns an array staring at the same cell, but extending w cells wide and h cells high. For example:

![image358.gif](media://acbdb2c0-21bd-40f4-9492-38664fb3753b)
</details>

> Macro (anchor)



<details>
<summary>OR</summary>

OR(condition1, condition2,&) returns a TRUE if any of the conditions are met, and a false otherwise. For example:

  


A1: 10

A2: 12

A3: 6

  


=OR(A1>10, A3>A1,A2>=2*A3) returns a TRUE

=OR(A1>10, A3>A1,A2<2*A3) returns a FALSE
</details>

> Macro (anchor)



<details>
<summary>PI</summary>

PI( ) returns the number 3.14159265358979, the mathematical constant pi, accurate to 15 digits.
</details>

> Macro (anchor)



<details>
<summary>ROUND</summary>

ROUND(x,digits) rounds off x to a certain number of decimal places:

  


ROUND(1234.5678,2) = 1234.57

ROUND(1234.5678,0) = 1235

ROUND(1234.5678,-2) = 1200
</details>

> Macro (anchor)



<details>
<summary>ROUNDUP</summary>

ROUNDUP(x,digits) rounds a number up, away from 0 (zero).
</details>

> Macro (anchor)



<details>
<summary>SIN</summary>

SIN(x) returns the sine of the given angle.
</details>

> Macro (anchor)



<details>
<summary>SQRT</summary>

SQRT(x) returns the square root of x, e.g. SQRT(16) = 4.
</details>

> Macro (anchor)



<details>
<summary>SUM</summary>

SUM({x}) returns the sum of the cells in the array {x}
</details>

> Macro (anchor)



<details>
<summary>SUMPRODUCT</summary>

SUMPRODUCT({x},{y},{z}, ...) multiplies corresponding components in the given arrays, and returns the sum of those products.
</details>

> Macro (anchor)



<details>
<summary>TODAY</summary>

TODAY( ) returns the serial number of the current date. The serial number is the date-time code used by Microsoft Excel for date and time calculations. If the cell format was General before the function was entered, the result is formatted as a date.
</details>

> Macro (anchor)



<details>
<summary>TRUE</summary>

TRUE( ) returns the logical value TRUE.
</details>

> Macro (anchor)



<details>
<summary>VLOOKUP</summary>

VLOOKUP(v,A,i) looks up in a table delineated by the area A. It searches for the value v in the first column, and then returns the value in the ith column of the same row. For example:  


![image359.gif](media://4b74a7fe-aaa9-4311-9013-142ff01a058b)

This is a useful function in combination with a probability distribution for selecting random or conditional values from tables. However, it can be somewhat tricky in predicting what it will do at the end of tables, and wont work properly unless the first column is put in ascending order. For these reasons we tend to use the functions OFFSET and INDEX for this purpose.
</details>

> Macro (anchor)



<details>
<summary>YEAR</summary>

YEAR(serial_number) returns the year corresponding to a date. The year is returned as an integer in the range 1900-9999.
</details>

  
  


  


---