# Function Reference

This appendix provides a list of all the functions which are currently defined in Gnumeric.

## Bitwise Operations

`BITAND`

`BITAND`

    BITAND(a,b)

#### Description

`BITAND` function returns bitwise and-ing of its arguments.

#### Examples

#### See also

`BITOR`, `BITXOR`.

`BITLSHIFT`

`BITLSHIFT`

    BITLSHIFT(x,n)

#### Description

`BITLSHIFT` function returns `x` bit-shifted left by `n` bits.

- If `n` is negative, a right shift will in effect be performed.

#### Examples

#### See also

`BITRSHIFT`.

`BITOR`

`BITOR`

    BITOR(a,b)

#### Description

`BITOR` function returns bitwise or-ing of its arguments.

#### Examples

#### See also

`BITXOR`, `BITAND`.

`BITRSHIFT`

`BITRSHIFT`

    BITRSHIFT(x,n)

#### Description

`BITRSHIFT` function returns `x` bit-shifted right by `n` bits.

- If `n` is negative, a left shift will in effect be performed.

#### Examples

#### See also

`BITLSHIFT`.

`BITXOR`

`BITXOR`

    BITXOR(a,b)

#### Description

`BITXOR` function returns bitwise exclusive or-ing of its arguments.

#### Examples

#### See also

`BITOR`, `BITAND`.

## Complex

`COMPLEX`

`COMPLEX`

    COMPLEX(real,im[,suffix])

#### Description

`COMPLEX` returns a complex number of the form x + yi.

`real` is the real and `im` is the imaginary part of the complex number. `suffix` is the suffix for the imaginary part. If it is omitted, `COMPLEX` uses 'i' by default.

- If `suffix` is neither 'i' nor 'j', `COMPLEX` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`COMPLEX`(1,-1) equals 1-i.

#### See also

`IMABS`

`IMABS`

    IMABS(inumber)

#### Description

`IMABS` returns the absolute value of a complex number.

- If `inumber` is not a valid complex number, `IMABS` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMABS`("2-j") equals 2.23606798.

#### See also

`IMAGINARY`, `IMREAL`.

`IMAGINARY`

`IMAGINARY`

    IMAGINARY(inumber)

#### Description

`IMAGINARY` returns the imaginary part of a complex number.

- If `inumber` is not a valid complex number, `IMAGINARY` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMAGINARY`("132-j") equals -1.

#### See also

`IMREAL`.

`IMARCCOS`

`IMARCCOS`

    IMARCCOS(inumber)

#### Description

`IMARCCOS` returns the complex arccosine of the complex number `inumber`. The branch cuts are on the real axis, less than -1 and greater than 1.

- If `inumber` is not a valid complex number, `IMARCCOS` returns #VALUE! error.

#### Examples

`IMARCCOS`("1+j") equals 0.9045569-1.061275j.

#### See also

`IMARCSIN`, `IMARCTAN`.

`IMARCCOSH`

`IMARCCOSH`

    IMARCCOSH(inumber)

#### Description

`IMARCCOSH` returns the complex hyperbolic arccosine of the complex number `inumber`. The branch cut is on the real axis, less than 1.

- If `inumber` is not a valid complex number, `IMARCCOSH` returns #VALUE! error.

#### Examples

`IMARCCOSH`("1+j") equals 1.06127506+0.904557j.

#### See also

`IMARCSINH`, `IMARCTANH`.

`IMARCCOT`

`IMARCCOT`

    IMARCCOT(inumber)

#### Description

`IMARCCOT` returns the complex arccotangent of the complex number z (`inumber`), where

arccot(z) = arctan(1/z).

- If `inumber` is not a valid complex number, `IMARCCOT` returns #VALUE! error.

#### Examples

`IMARCCOT`("1+j") equals 0.553574+0.4023595j.

#### See also

`IMARCSEC`, `IMARCCSC`.

`IMARCCOTH`

`IMARCCOTH`

    IMARCCOTH(inumber)

#### Description

`IMARCCOTH` returns the complex hyperbolic arccotangent of the complex number z (`inumber`), where

arccoth(z) = arctanh(1/z).

- If `inumber` is not a valid complex number, `IMARCCOTH` returns #VALUE! error.

#### Examples

`IMARCCOTH`("1+j") equals 0.40235948-0.5535744j.

#### See also

`IMARCSECH`, `IMARCCSCH`.

`IMARCCSC`

`IMARCCSC`

    IMARCCSC(inumber)

#### Description

`IMARCCSC` returns the complex arccosecant of the complex number z (`inumber`), where

arccsc(z) = arcsin(1/z).

- If `inumber` is not a valid complex number, `IMARCCSC` returns #VALUE! error.

#### Examples

`IMARCCSC`("1+j") equals 0.45227845-0.5306375j.

#### See also

`IMARCSEC`, `IMARCCOT`.

`IMARCCSCH`

`IMARCCSCH`

    IMARCCSCH(inumber)

#### Description

`IMARCCSCH` returns the complex hyperbolic arccosecant of the complex number z (`inumber`), where

arccsch(z) = arcsinh(1/z).

- If `inumber` is not a valid complex number, `IMARCCSCH` returns #VALUE! error.

#### Examples

`IMARCCSCH`("1+j") equals 0.5306375-0.452278j.

#### See also

`IMARCSECH`, `IMARCCOTH`.

`IMARCSEC`

`IMARCSEC`

    IMARCSEC(inumber)

#### Description

`IMARCSEC` returns the complex arcsecant of the complex number z (`inumber`), where

arcsec(z) = arccos(1/z).

- If `inumber` is not a valid complex number, `IMARCSEC` returns #VALUE! error.

#### Examples

`IMARCSEC`("1+j") equals 1.1185179+0.5306375j.

#### See also

`IMARCCSC`, `IMARCCOT`.

`IMARCSECH`

`IMARCSECH`

    IMARCSECH(inumber)

#### Description

`IMARCSECH` returns the complex hyperbolic arcsecant of the complex number z (`inumber`), where

arcsech(z) = arccosh(1/z).

- If `inumber` is not a valid complex number, `IMARCSECH` returns #VALUE! error.

#### Examples

`IMARCSECH`("1+j") equals 0.5306375-1.118518j.

#### See also

`IMARCCSCH`, `IMARCCOTH`.

`IMARCSIN`

`IMARCSIN`

    IMARCSIN(inumber)

#### Description

`IMARCSIN` returns the complex arcsine of the complex number `inumber`. The branch cuts are on the real axis, less than -1 and greater than 1.

- If `inumber` is not a valid complex number, `IMARCSIN` returns #VALUE! error.

#### Examples

`IMARCSIN`("1+j") equals 0.6662394+1.061275j.

#### See also

`IMARCCOS`, `IMARCTAN`.

`IMARCSINH`

`IMARCSINH`

    IMARCSINH(inumber)

#### Description

`IMARCSINH` returns the complex hyperbolic arcsine of the complex number `inumber`. The branch cuts are on the imaginary axis, below -i and above i.

- If `inumber` is not a valid complex number, `IMARCSINH` returns #VALUE! error.

#### Examples

`IMARCSINH`("1+j") equals 1.061275+0.6662394j.

#### See also

`IMARCCOSH`, `IMARCTANH`.

`IMARCTAN`

`IMARCTAN`

    IMARCTAN(inumber)

#### Description

`IMARCTAN` returns the complex arctangent of the complex number `inumber`. The branch cuts are on the imaginary axis, below -i and above i.

- If `inumber` is not a valid complex number, `IMARCTAN` returns #VALUE! error.

#### Examples

`IMARCTAN`("1+j") equals 1.0172220+0.4023595j.

#### See also

`IMARCSIN`, `IMARCCOS`.

`IMARCTANH`

`IMARCTANH`

    IMARCTANH(inumber)

#### Description

`IMARCTANH` returns the complex hyperbolic arctangent of the complex number `inumber`. The branch cuts are on the real axis, less than -1 and greater than 1.

- If `inumber` is not a valid complex number, `IMARCTANH` returns #VALUE! error.

#### Examples

`IMARCTANH`("1+j") equals 0.4023595+1.0172220j.

#### See also

`IMARCSINH`, `IMARCCOSH`.

`IMARGUMENT`

`IMARGUMENT`

    IMARGUMENT(inumber)

#### Description

`IMARGUMENT` returns the argument theta of a complex number, i.e. the angle in radians from the real axis to the representation of the number in polar coordinates.

- If `inumber` is not a valid complex number, `IMARGUMENT` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMARGUMENT`("2-j") equals -0.463647609.

#### See also

`IMCONJUGATE`

`IMCONJUGATE`

    IMCONJUGATE(inumber)

#### Description

`IMCONJUGATE` returns the complex conjugate of a complex number.

- If `inumber` is not a valid complex number, `IMCONJUGATE` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMCONJUGATE`("1-j") equals 1+j.

#### See also

`IMAGINARY`, `IMREAL`.

`IMCOS`

`IMCOS`

    IMCOS(inumber)

#### Description

`IMCOS` returns the cosine of a complex number.

- If `inumber` is not a valid complex number, `IMCOS` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMCOS`("1+j") equals 0.833730-0.988898j.

#### See also

`IMSIN`, `IMTAN`.

`IMCOSH`

`IMCOSH`

    IMCOSH(inumber)

#### Description

`IMCOSH` returns the complex hyperbolic cosine of the complex number z (`inumber`), where

cosh(z) = (exp(z) + exp(-z))/2.

- If `inumber` is not a valid complex number, `IMCOSH` returns #VALUE! error.

#### Examples

`IMCOSH`("1+j") equals 0.83373+0.988898j.

#### See also

`IMSINH`, `IMTANH`.

`IMCOT`

`IMCOT`

    IMCOT(inumber)

#### Description

`IMCOT` returns the complex cotangent of the complex number z (`inumber`), where

cot(z) = 1/tan(z).

- If `inumber` is not a valid complex number, `IMCOT` returns #VALUE! error.

#### Examples

`IMCOT`("2-j") equals -0.171384+0.821330j.

#### See also

`IMSEC`, `IMCSC`.

`IMCOTH`

`IMCOTH`

    IMCOTH(inumber)

#### Description

`IMCOTH` returns the complex hyperbolic cotangent of the complex number z (`inumber`) where,

coth(z) = 1/tanh(z).

- If `inumber` is not a valid complex number, `IMCOTH` returns #VALUE! error.

#### Examples

`IMCOTH`("1+j") equals 0.868014-0.217622j.

#### See also

`IMSECH`, `IMCSCH`.

`IMCSC`

`IMCSC`

    IMCSC(inumber)

#### Description

`IMCSC` returns the complex cosecant of the complex number z (`inumber`), where

csc(z) = 1/sin(z).

- If `inumber` is not a valid complex number, `IMCSC` returns #VALUE! error.

#### Examples

`IMCSC`("2-j") equals 0.635494-0.221501j.

#### See also

`IMSEC`, `IMCOT`.

`IMCSCH`

`IMCSCH`

    IMCSCH(inumber)

#### Description

`IMCSCH` returns the complex hyperbolic cosecant of the complex number z (`inumber`), where

csch(z) = 1/sinh(z).

- If `inumber` is not a valid complex number, `IMCSCH` returns #VALUE! error.

#### Examples

`IMCSCH`("1+j") equals 0.303931-0.621518j.

#### See also

`IMSECH`, `IMCOTH`.

`IMDIV`

`IMDIV`

    IMDIV(inumber1,inumber2)

#### Description

`IMDIV` returns the quotient of two complex numbers.

- If `inumber1` or `inumber2` are not valid complex numbers, `IMDIV` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMDIV`("2-j","2+j") equals 0.6-0.8j.

#### See also

`IMPRODUCT`.

`IMEXP`

`IMEXP`

    IMEXP(inumber)

#### Description

`IMEXP` returns the exponential of a complex number.

- If `inumber` is not a valid complex number, `IMEXP` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMEXP`("2-j") equals 3.992324-6.217676j.

#### See also

`IMLN`.

`IMINV`

`IMINV`

    IMINV(inumber)

#### Description

`IMINV` returns the the inverse, or reciprocal, of the complex number z (`inumber`), where

1/z = (x - i y)/(x^2 + y^2).

- If `inumber` is not a valid complex number, `IMINV` returns #VALUE! error.

#### Examples

`IMINV`("1-j") equals 0.5+0.5j.

#### See also

`IMLN`

`IMLN`

    IMLN(inumber)

#### Description

`IMLN` returns the natural logarithm of a complex number.

The result will have an imaginary part between -pi and +pi. The natural logarithm is not uniquely defined on complex numbers. You may need to add or subtract an even multiple of pi to the imaginary part.

- If `inumber` is not a valid complex number, `IMLN` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMLN`("3-j") equals 1.15129-0.32175j.

#### See also

`IMEXP`, `IMLOG2`, `IMLOG10`.

`IMLOG10`

`IMLOG10`

    IMLOG10(inumber)

#### Description

`IMLOG10` returns the logarithm of a complex number in base 10.

- If `inumber` is not a valid complex number, `IMLOG10` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMLOG10`("3-j") equals 0.5-0.13973j.

#### See also

`IMLN`, `IMLOG2`.

`IMLOG2`

`IMLOG2`

    IMLOG2(inumber)

#### Description

`IMLOG2` returns the logarithm of a complex number in base 2.

- If `inumber` is not a valid complex number, `IMLOG2` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMLOG2`("3-j") equals 1.66096-0.46419j.

#### See also

`IMLN`, `IMLOG10`.

`IMNEG`

`IMNEG`

    IMNEG(inumber)

#### Description

`IMNEG` returns the negative of the complex number z (`inumber`), where

-z = (-x) + i(-y).

- If `inumber` is not a valid complex number, `IMNEG` returns #VALUE! error.

#### Examples

`IMNEG`("1-j") equals -1+j.

#### See also

`IMPOWER`

`IMPOWER`

    IMPOWER(inumber1,inumber2)

#### Description

`IMPOWER` returns a complex number raised to a power. `inumber1` is the complex number to be raised to a power and `inumber2` is the power to which you want to raise it.

- If `inumber1` or `inumber2` are not valid complex numbers, `IMPOWER` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMPOWER`("4-j",2) equals 15-8j.

#### See also

`IMSQRT`.

`IMPRODUCT`

`IMPRODUCT`

    IMPRODUCT(inumber1[,inumber2,...])

#### Description

`IMPRODUCT` returns the product of given complex numbers.

- If any of the `inumbers` are not valid complex numbers, `IMPRODUCT` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMPRODUCT`("2-j","4-2j") equals 6-8j.

#### See also

`IMDIV`.

`IMREAL`

`IMREAL`

    IMREAL(inumber)

#### Description

`IMREAL` returns the real part of a complex number.

- If `inumber` is not a valid complex number, `IMREAL` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

imreal("132-j") equals 132.

#### See also

`IMAGINARY`.

`IMSEC`

`IMSEC`

    IMSEC(inumber)

#### Description

`IMSEC` returns the complex secant of the complex number z (`inumber`), where

sec(z) = 1/cos(z).

- If `inumber` is not a valid complex number, `IMSEC` returns #VALUE! error.

#### Examples

`IMSEC`("2-j") equals -0.413149-0.687527j.

#### See also

`IMCSC`, `IMCOT`.

`IMSECH`

`IMSECH`

    IMSECH(inumber)

#### Description

`IMSECH` returns the complex hyperbolic secant of the complex number z (`inumber`), where

sech(z) = 1/cosh(z).

- If `inumber` is not a valid complex number, `IMSECH` returns #VALUE! error.

#### Examples

`IMSECH`("1+j") equals 0.498337-0.5910838j.

#### See also

`IMCSCH`, `IMCOTH`.

`IMSIN`

`IMSIN`

    IMSIN(inumber)

#### Description

`IMSIN` returns the sine of a complex number.

- If `inumber` is not a valid complex number, `IMSIN` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMSIN`("1+j") equals 1.29846+0.63496j.

#### See also

`IMCOS`, `IMTAN`.

`IMSINH`

`IMSINH`

    IMSINH(inumber)

#### Description

`IMSINH` returns the complex hyperbolic sine of the complex number z (`inumber`), where

sinh(z) = (exp(z) - exp(-z))/2.

- If `inumber` is not a valid complex number, `IMSINH` returns #VALUE! error.

#### Examples

`IMSINH`("1+j") equals 0.63496+1.29846j.

#### See also

`IMCOSH`, `IMTANH`.

`IMSQRT`

`IMSQRT`

    IMSQRT(inumber)

#### Description

`IMSQRT` returns the square root of a complex number.

- If `inumber` is not a valid complex number, `IMSQRT` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMSQRT`("1+j") equals 1.09868+0.4550899j.

#### See also

`IMPOWER`.

`IMSUB`

`IMSUB`

    IMSUB(inumber1,inumber2)

#### Description

`IMSUB` returns the difference of two complex numbers.

- If `inumber1` or `inumber2` are not valid complex numbers, `IMSUB` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMSUB`("3-j","2+j") equals 1-2j.

#### See also

`IMSUM`.

`IMSUM`

`IMSUM`

    IMSUM(inumber1,inumber2)

#### Description

`IMSUM` returns the sum of two complex numbers.

- If `inumber1` or `inumber2` are not valid complex numbers, `IMSUM` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMSUM`("2-4j","9-j") equals 11-5j.

#### See also

`IMSUB`.

`IMTAN`

`IMTAN`

    IMTAN(inumber)

#### Description

`IMTAN` returns the tangent of a complex number.

- If `inumber` is not a valid complex number, `IMTAN` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`IMTAN`("2-j") equals -0.2434582-1.1667363j.

#### See also

`IMSIN`, `IMCOS`.

`IMTANH`

`IMTANH`

    IMTANH(inumber)

#### Description

`IMTANH` returns the complex hyperbolic tangent of the complex number z (`inumber`), where

tanh(z) = sinh(z)/cosh(z).

- If `inumber` is not a valid complex number, `IMTANH` returns #VALUE! error.

#### Examples

`IMTANH`("1+j") equals 1.083923+0.2717526j.

#### See also

`IMSINH`, `IMCOSH`.

## Database

`DAVERAGE`

`DAVERAGE`

    DAVERAGE(database,field,criteria)

#### Description

`DAVERAGE` function returns the average of the values in a list or database that match conditions specified.

`database` is a range of cells in which rows of related information are records and columns of data are fields. The first row of a database contains labels for each column.

`field` specifies which column is used in the function. If `field` is an integer, for example 2, the second column is used. Field can also be the label of a column. For example, ``Age'' refers to the column with the label ``Age'' in `database` range.

`criteria` is the range of cells which contains the specified conditions. The first row of a `criteria` should contain the labels of the fields for which the criteria are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifying a value, e.g. ``3'' or ``John''.

Each row in `criteria` specifies a separate condition. If a row in `database` matches a row in `criteria`, then that row is counted. Technically speaking, this a boolean OR operation between the rows in `criteria`.

If `criteria` specifies more than one column, then each of the conditions in the specified columns must be true for the row in `database` to match. Technically speaking, this is a boolean AND operation between the columns in `criteria`.

#### Examples

Let us assume that the range A1:C7 contain the following values:

Name Age Salary

John 34 54342

Bill 35 22343

Clark 29 34323

Bob 43 47242

Susan 37 42932

Jill 45 45324

In addition, the cells A9:B11 contain the following values:

Age Salary

<30

>40 >46000

`DAVERAGE`(A1:C7, "Salary", A9:A11) equals 42296.3333.

`DAVERAGE`(A1:C7, "Age", A9:A11) equals 39.

`DAVERAGE`(A1:C7, "Salary", A9:B11) equals 40782.5.

`DAVERAGE`(A1:C7, "Age", A9:B11) equals 36.

#### See also

`DCOUNT`.

`DCOUNT`

`DCOUNT`

    DCOUNT(database,field,criteria)

#### Description

`DCOUNT` function counts the cells that contain numbers in a database that match conditions specified.

`database` is a range of cells in which rows of related information are records and columns of data are fields. The first row of a database contains labels for each column.

`field` specifies which column is used in the function. If `field` is an integer, for example 2, the second column is used. Field can also be the label of a column. For example, ``Age'' refers to the column with the label ``Age'' in `database` range.

`criteria` is the range of cells which contains the specified conditions. The first row of a `criteria` should contain the labels of the fields for which the criteria are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifying a value, e.g. ``3'' or ``John''.

Each row in `criteria` specifies a separate condition. If a row in `database` matches a row in `criteria`, then that row is counted. Technically speaking, this a boolean OR operation between the rows in `criteria`.

If `criteria` specifies more than one column, then each of the conditions in the specified columns must be true for the row in `database` to match. Technically speaking, this is a boolean AND operation between the columns in `criteria`.

#### Examples

Let us assume that the range A1:C7 contain the following values:

Name Age Salary

John 34 54342

Bill 35 22343

Clark 29 34323

Bob 43 47242

Susan 37 42932

Jill 45 45324

In addition, the cells A9:B11 contain the following values:

Age Salary

<30

>40 >46000

`DCOUNT`(A1:C7, "Salary", A9:A11) equals 3.

`DCOUNT`(A1:C7, "Salary", A9:B11) equals 2.

`DCOUNT`(A1:C7, "Name", A9:B11) equals 0.

#### See also

`DAVERAGE`.

`DCOUNTA`

`DCOUNTA`

    DCOUNTA(database,field,criteria)

#### Description

`DCOUNTA` function counts the cells that contain data in a database that match conditions specified.

`database` is a range of cells in which rows of related information are records and columns of data are fields. The first row of a database contains labels for each column.

`field` specifies which column is used in the function. If `field` is an integer, for example 2, the second column is used. Field can also be the label of a column. For example, ``Age'' refers to the column with the label ``Age'' in `database` range.

`criteria` is the range of cells which contains the specified conditions. The first row of a `criteria` should contain the labels of the fields for which the criteria are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifying a value, e.g. ``3'' or ``John''.

Each row in `criteria` specifies a separate condition. If a row in `database` matches a row in `criteria`, then that row is counted. Technically speaking, this a boolean OR operation between the rows in `criteria`.

If `criteria` specifies more than one column, then each of the conditions in the specified columns must be true for the row in `database` to match. Technically speaking, this is a boolean AND operation between the columns in `criteria`.

#### Examples

Let us assume that the range A1:C7 contain the following values:

Name Age Salary

John 34 54342

Bill 35 22343

Clark 29 34323

Bob 43 47242

Susan 37 42932

Jill 45 45324

In addition, the cells A9:B11 contain the following values:

Age Salary

<30

>40 >46000

`DCOUNTA`(A1:C7, "Salary", A9:A11) equals 3.

`DCOUNTA`(A1:C7, "Salary", A9:B11) equals 2.

`DCOUNTA`(A1:C7, "Name", A9:B11) equals 2.

#### See also

`DCOUNT`.

`DGET`

`DGET`

    DGET(database,field,criteria)

#### Description

`DGET` function returns a single value from a column that match conditions specified.

`database` is a range of cells in which rows of related information are records and columns of data are fields. The first row of a database contains labels for each column.

`field` specifies which column is used in the function. If `field` is an integer, for example 2, the second column is used. Field can also be the label of a column. For example, ``Age'' refers to the column with the label ``Age'' in `database` range.

`criteria` is the range of cells which contains the specified conditions. The first row of a `criteria` should contain the labels of the fields for which the criteria are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifying a value, e.g. ``3'' or ``John''.

Each row in `criteria` specifies a separate condition. If a row in `database` matches a row in `criteria`, then that row is counted. Technically speaking, this a boolean OR operation between the rows in `criteria`.

If `criteria` specifies more than one column, then each of the conditions in the specified columns must be true for the row in `database` to match. Technically speaking, this is a boolean AND operation between the columns in `criteria`.

#### Examples

Let us assume that the range A1:C7 contain the following values:

Name Age Salary

John 34 54342

Bill 35 22343

Clark 29 34323

Bob 43 47242

Susan 37 42932

Jill 45 45324

In addition, the cells A9:B11 contain the following values:

Age Salary

<30

>40 >46000

- If none of the items match the conditions, `DGET` returns #VALUE! error.

- If more than one items match the conditions, `DGET` returns #NUM! error.

`DGET`(A1:C7, "Salary", A9:A10) equals 34323.

`DGET`(A1:C7, "Name", A9:A10) equals "Clark".

#### See also

`DCOUNT`.

`DMAX`

`DMAX`

    DMAX(database,field,criteria)

#### Description

`DMAX` function returns the largest number in a column that match conditions specified.

`database` is a range of cells in which rows of related information are records and columns of data are fields. The first row of a database contains labels for each column.

`field` specifies which column is used in the function. If `field` is an integer, for example 2, the second column is used. Field can also be the label of a column. For example, ``Age'' refers to the column with the label ``Age'' in `database` range.

`criteria` is the range of cells which contains the specified conditions. The first row of a `criteria` should contain the labels of the fields for which the criteria are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifying a value, e.g. ``3'' or ``John''.

Each row in `criteria` specifies a separate condition. If a row in `database` matches a row in `criteria`, then that row is counted. Technically speaking, this a boolean OR operation between the rows in `criteria`.

If `criteria` specifies more than one column, then each of the conditions in the specified columns must be true for the row in `database` to match. Technically speaking, this is a boolean AND operation between the columns in `criteria`.

#### Examples

Let us assume that the range A1:C7 contain the following values:

Name Age Salary

John 34 54342

Bill 35 22343

Clark 29 34323

Bob 43 47242

Susan 37 42932

Jill 45 45324

In addition, the cells A9:B11 contain the following values:

Age Salary

<30

>40 >46000

`DMAX`(A1:C7, "Salary", A9:A11) equals 47242.

`DMAX`(A1:C7, "Age", A9:A11) equals 45.

`DMAX`(A1:C7, "Age", A9:B11) equals 43.

#### See also

`DMIN`.

`DMIN`

`DMIN`

    DMIN(database,field,criteria)

#### Description

`DMIN` function returns the smallest number in a column that match conditions specified.

`database` is a range of cells in which rows of related information are records and columns of data are fields. The first row of a database contains labels for each column.

`field` specifies which column is used in the function. If `field` is an integer, for example 2, the second column is used. Field can also be the label of a column. For example, ``Age'' refers to the column with the label ``Age'' in `database` range.

`criteria` is the range of cells which contains the specified conditions. The first row of a `criteria` should contain the labels of the fields for which the criteria are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifying a value, e.g. ``3'' or ``John''.

Each row in `criteria` specifies a separate condition. If a row in `database` matches a row in `criteria`, then that row is counted. Technically speaking, this a boolean OR operation between the rows in `criteria`.

If `criteria` specifies more than one column, then each of the conditions in the specified columns must be true for the row in `database` to match. Technically speaking, this is a boolean AND operation between the columns in `criteria`.

#### Examples

Let us assume that the range A1:C7 contain the following values:

Name Age Salary

John 34 54342

Bill 35 22343

Clark 29 34323

Bob 43 47242

Susan 37 42932

Jill 45 45324

In addition, the cells A9:B11 contain the following values:

Age Salary

<30

>40 >46000

`DMIN`(A1:C7, "Salary", A9:B11) equals 34323.

`DMIN`(A1:C7, "Age", A9:B11) equals 29.

#### See also

`DMAX`.

`DPRODUCT`

`DPRODUCT`

    DPRODUCT(database,field,criteria)

#### Description

`DPRODUCT` function returns the product of numbers in a column that match conditions specified.

`database` is a range of cells in which rows of related information are records and columns of data are fields. The first row of a database contains labels for each column.

`field` specifies which column is used in the function. If `field` is an integer, for example 2, the second column is used. Field can also be the label of a column. For example, ``Age'' refers to the column with the label ``Age'' in `database` range.

`criteria` is the range of cells which contains the specified conditions. The first row of a `criteria` should contain the labels of the fields for which the criteria are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifying a value, e.g. ``3'' or ``John''.

Each row in `criteria` specifies a separate condition. If a row in `database` matches a row in `criteria`, then that row is counted. Technically speaking, this a boolean OR operation between the rows in `criteria`.

If `criteria` specifies more than one column, then each of the conditions in the specified columns must be true for the row in `database` to match. Technically speaking, this is a boolean AND operation between the columns in `criteria`.

#### Examples

Let us assume that the range A1:C7 contain the following values:

Name Age Salary

John 34 54342

Bill 35 22343

Clark 29 34323

Bob 43 47242

Susan 37 42932

Jill 45 45324

In addition, the cells A9:B11 contain the following values:

Age Salary

<30

>40 >46000

`DPRODUCT`(A1:C7, "Age", A9:B11) equals 1247.

#### See also

`DSUM`.

`DSTDEV`

`DSTDEV`

    DSTDEV(database,field,criteria)

#### Description

`DSTDEV` function returns the estimate of the standard deviation of a population based on a sample. The populations consists of numbers that match conditions specified.

`database` is a range of cells in which rows of related information are records and columns of data are fields. The first row of a database contains labels for each column.

`field` specifies which column is used in the function. If `field` is an integer, for example 2, the second column is used. Field can also be the label of a column. For example, ``Age'' refers to the column with the label ``Age'' in `database` range.

`criteria` is the range of cells which contains the specified conditions. The first row of a `criteria` should contain the labels of the fields for which the criteria are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifying a value, e.g. ``3'' or ``John''.

Each row in `criteria` specifies a separate condition. If a row in `database` matches a row in `criteria`, then that row is counted. Technically speaking, this a boolean OR operation between the rows in `criteria`.

If `criteria` specifies more than one column, then each of the conditions in the specified columns must be true for the row in `database` to match. Technically speaking, this is a boolean AND operation between the columns in `criteria`.

#### Examples

Let us assume that the range A1:C7 contain the following values:

Name Age Salary

John 34 54342

Bill 35 22343

Clark 29 34323

Bob 43 47242

Susan 37 42932

Jill 45 45324

In addition, the cells A9:B11 contain the following values:

Age Salary

<30

>40 >46000

`DSTDEV`(A1:C7, "Age", A9:B11) equals 9.89949.

`DSTDEV`(A1:C7, "Salary", A9:B11) equals 9135.112506.

#### See also

`DSTDEVP`.

`DSTDEVP`

`DSTDEVP`

    DSTDEVP(database,field,criteria)

#### Description

`DSTDEVP` function returns the standard deviation of a population based on the entire populations. The populations consists of numbers that match conditions specified.

`database` is a range of cells in which rows of related information are records and columns of data are fields. The first row of a database contains labels for each column.

`field` specifies which column is used in the function. If `field` is an integer, for example 2, the second column is used. Field can also be the label of a column. For example, ``Age'' refers to the column with the label ``Age'' in `database` range.

`criteria` is the range of cells which contains the specified conditions. The first row of a `criteria` should contain the labels of the fields for which the criteria are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifying a value, e.g. ``3'' or ``John''.

Each row in `criteria` specifies a separate condition. If a row in `database` matches a row in `criteria`, then that row is counted. Technically speaking, this a boolean OR operation between the rows in `criteria`.

If `criteria` specifies more than one column, then each of the conditions in the specified columns must be true for the row in `database` to match. Technically speaking, this is a boolean AND operation between the columns in `criteria`.

#### Examples

Let us assume that the range A1:C7 contain the following values:

Name Age Salary

John 34 54342

Bill 35 22343

Clark 29 34323

Bob 43 47242

Susan 37 42932

Jill 45 45324

In addition, the cells A9:B11 contain the following values:

Age Salary

<30

>40 >46000

`DSTDEVP`(A1:C7, "Age", A9:B11) equals 7.

`DSTDEVP`(A1:C7, "Salary", A9:B11) equals 6459.5.

#### See also

`DSTDEV`.

`DSUM`

`DSUM`

    DSUM(database,field,criteria)

#### Description

`DSUM` function returns the sum of numbers in a column that match conditions specified.

`database` is a range of cells in which rows of related information are records and columns of data are fields. The first row of a database contains labels for each column.

`field` specifies which column is used in the function. If `field` is an integer, for example 2, the second column is used. Field can also be the label of a column. For example, ``Age'' refers to the column with the label ``Age'' in `database` range.

`criteria` is the range of cells which contains the specified conditions. The first row of a `criteria` should contain the labels of the fields for which the criteria are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifying a value, e.g. ``3'' or ``John''.

Each row in `criteria` specifies a separate condition. If a row in `database` matches a row in `criteria`, then that row is counted. Technically speaking, this a boolean OR operation between the rows in `criteria`.

If `criteria` specifies more than one column, then each of the conditions in the specified columns must be true for the row in `database` to match. Technically speaking, this is a boolean AND operation between the columns in `criteria`.

#### Examples

Let us assume that the range A1:C7 contain the following values:

Name Age Salary

John 34 54342

Bill 35 22343

Clark 29 34323

Bob 43 47242

Susan 37 42932

Jill 45 45324

In addition, the cells A9:B11 contain the following values:

Age Salary

<30

>40 >46000

`DSUM`(A1:C7, "Age", A9:B11) equals 72.

`DSUM`(A1:C7, "Salary", A9:B11) equals 81565.

#### See also

`DPRODUCT`.

`DVAR`

`DVAR`

    DVAR(database,field,criteria)

#### Description

`DVAR` function returns the estimate of variance of a population based on a sample. The populations consists of numbers that match conditions specified.

`database` is a range of cells in which rows of related information are records and columns of data are fields. The first row of a database contains labels for each column.

`field` specifies which column is used in the function. If `field` is an integer, for example 2, the second column is used. Field can also be the label of a column. For example, ``Age'' refers to the column with the label ``Age'' in `database` range.

`criteria` is the range of cells which contains the specified conditions. The first row of a `criteria` should contain the labels of the fields for which the criteria are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifying a value, e.g. ``3'' or ``John''.

Each row in `criteria` specifies a separate condition. If a row in `database` matches a row in `criteria`, then that row is counted. Technically speaking, this a boolean OR operation between the rows in `criteria`.

If `criteria` specifies more than one column, then each of the conditions in the specified columns must be true for the row in `database` to match. Technically speaking, this is a boolean AND operation between the columns in `criteria`.

#### Examples

Let us assume that the range A1:C7 contain the following values:

Name Age Salary

John 34 54342

Bill 35 22343

Clark 29 34323

Bob 43 47242

Susan 37 42932

Jill 45 45324

In addition, the cells A9:B11 contain the following values:

Age Salary

<30

>40 >46000

`DVAR`(A1:C7, "Age", A9:B11) equals 98.

`DVAR`(A1:C7, "Salary", A9:B11) equals 83450280.5.

#### See also

`DVARP`.

`DVARP`

`DVARP`

    DVARP(database,field,criteria)

#### Description

`DVARP` function returns the variance of a population based on the entire populations. The populations consists of numbers that match conditions specified.

`database` is a range of cells in which rows of related information are records and columns of data are fields. The first row of a database contains labels for each column.

`field` specifies which column is used in the function. If `field` is an integer, for example 2, the second column is used. Field can also be the label of a column. For example, ``Age'' refers to the column with the label ``Age'' in `database` range.

`criteria` is the range of cells which contains the specified conditions. The first row of a `criteria` should contain the labels of the fields for which the criteria are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifying a value, e.g. ``3'' or ``John''.

Each row in `criteria` specifies a separate condition. If a row in `database` matches a row in `criteria`, then that row is counted. Technically speaking, this a boolean OR operation between the rows in `criteria`.

If `criteria` specifies more than one column, then each of the conditions in the specified columns must be true for the row in `database` to match. Technically speaking, this is a boolean AND operation between the columns in `criteria`.

#### Examples

Let us assume that the range A1:C7 contain the following values:

Name Age Salary

John 34 54342

Bill 35 22343

Clark 29 34323

Bob 43 47242

Susan 37 42932

Jill 45 45324

In addition, the cells A9:B11 contain the following values:

Age Salary

<30

>40 >46000

`DVARP`(A1:C7, "Age", A9:B11) equals 49.

`DVARP`(A1:C7, "Salary", A9:B11) equals 41725140.25.

#### See also

`DVAR`.

`EXECSQL`

`EXECSQL`

    EXECSQL(dsn,username,password,sql)

#### Description

The `EXECSQL` function lets you execute a command in a database server, and show the results returned in current sheet. It uses libgda as the means for accessing the databases.

For using it, you need first to set up a libgda data source.

#### Examples

To get all the data from the table "Customers" present in the "mydatasource" GDA data source, you would use:

`EXECSQL`("mydatasource","username","password","SELECT * FROM customers")

#### See also

`READDBTABLE`.

`GETPIVOTDATA`

`GETPIVOTDATA`

    GETPIVOTDATA(pivot_table,field_name)

#### Description

`GETPIVOTDATA` function fetches summary data from a pivot table. `pivot_table` is a cell range containing the pivot table. `field_name` is the name of the field of which you want the summary data.

- If the summary data is unavailable, `GETPIVOTDATA` returns #REF! error.

#### Examples

#### See also

`READDBTABLE`

`READDBTABLE`

    READDBTABLE(dsn,username,password,table)

#### Description

The `READDBTABLE` function lets you get the contents of a table, as stored in a database.For using it, you need first to set up a libgda data source.

Note that this function returns all the rows in the given table. If you want to get data from more than one table or want a more precise selection (conditions), use the EXECSQL function.

#### Examples

To get all the data from the table "Customers" present in the "mydatasource" GDA data source, you would use:

`READDBTABLE`("mydatasource","username","password","customers")

#### See also

`EXECSQL`.

## Date/Time

`DATE`

`DATE`

    DATE (year,month,day)

#### Description

`DATE` returns the number of days since the 1st of January of 1900(the date serial number) for the given year, month and day.

- If `month` < 1 or `month` > 12, the year will be corrected. A similar correction takes place for days.

- The `years` should be at least 1900. If `years` < 1900, it is assumed to be 1900 + `years`.

- If the given date is not valid, `DATE` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`DATE`(2001, 3, 30) returns 'Mar 30, 2001'.

#### See also

`TODAY`, `NOW`.

`DATE2UNIX`

`DATE2UNIX`

    DATE2UNIX(serial)

#### Description

`DATE2UNIX` converts a spreadsheet date and time serial number into a unix time.

A unix time is the number of seconds since midnight January 1, 1970.

#### Examples

`DATE2UNIX`("01/01/2000") equals 946656000.

#### See also

`NOW`, `DATE`, `UNIX2DATE`.

`DATEDIF`

`DATEDIF`

    DATEDIF(date1,date2,interval)

#### Description

`DATEDIF` returns the difference between two dates. `interval` is one of six possible values: "y", "m", "d", "ym", "md", and "yd".

The first three options will return the number of complete years, months, or days, respectively, between the two dates specified.

"ym" will return the number of full months between the two dates, not including the difference in years.

"md" will return the number of full days between the two dates, not including the difference in months.

"yd" will return the number of full days between the two dates, not including the difference in years.

- This function is Excel compatible.

#### Examples

`DATEDIF`(DATE(2000,4,30),DATE(2003,8,4),"d") equals 1191.

`DATEDIF`(DATE(2000,4,30),DATE(2003,8,4),"y") equals 3.

#### See also

`DATE`.

`DATEVALUE`

`DATEVALUE`

    DATEVALUE(date_str)

#### Description

`DATEVALUE` returns the serial number of the date. `date_str` is the string that contains the date. The value depends on the date convention. The MS Excel 1900 convention dates things from Jan 1 1900 while the 1904 convention uses Jan 1 1904.

- This function is Excel compatible.

#### Examples

`DATEVALUE`("1/1/1999") equals 36161 (in the 1900 convention).

#### See also

`DATE`.

`DAY`

`DAY`

    DAY (date)

#### Description

`DAY` converts a serial number to a day of month.

- Note that Gnumeric will perform regular string to serial number conversion for you, so you can enter a date as a string.

- This function is Excel compatible.

#### Examples

`DAY`("10/24/1968") equals 24.

#### See also

`MONTH`, `TIME`, `NOW`, `YEAR`.

`DAYS360`

`DAYS360`

    DAYS360 (date1,date2,method)

#### Description

`DAYS360` returns the number of days from `date1` to `date2` following a 360-day calendar in which all months are assumed to have 30 days.

- If `method` is 1, the European method will be used. In this case, if the day of the month is 31 it will be considered as 30.

- If `method` is 0 or omitted, the XL US method will be used. This is a somewhat complicated industry standard method where the last day of February is considered to be the 30th day of the month, but only for the first date.

- If `method` is 2, a saner version of the US method is used in which both dates get the same February treatment.

- Note that Gnumeric will perform regular string to serial number conversion for you, so you can enter a date as a string.

- This function is mostly Excel compatible.

#### Examples

`DAYS360`(DATE(2003, 2, 3), DATE(2007, 4, 2)) equals 1499.

#### See also

`MONTH`, `TIME`, `NOW`, `YEAR`.

`EDATE`

`EDATE`

    EDATE(date,months)

#### Description

`EDATE` returns the serial number of the date that is the specified number of months before or after a given date. `date` is the serial number of the initial date and `months` is the number of months before (negative number) or after (positive number) the initial date.

- If `months` is not an integer, it is truncated.

- This function is Excel compatible.

#### Examples

`EDATE`(DATE(2001,12,30),2) returns 'Feb 28, 2002'.

#### See also

`DATE`.

`EOMONTH`

`EOMONTH`

    EOMONTH (start_date,months)

#### Description

`EOMONTH` returns the last day of the month which is `months` from the `start_date`.

- `EOMONTH` returns #NUM! if `start_date` or `months` are invalid.

- This function is Excel compatible.

#### Examples

If A1 contains 12/21/00 then `EOMONTH`(A1,0)=12/31/00, `EOMONTH`(A1,5)=5/31/01, and `EOMONTH`(A1,2)=2/28/01

#### See also

`MONTH`.

`HOUR`

`HOUR`

    HOUR (date)

#### Description

`HOUR` converts a serial number to an hour. The hour is returned as an integer in the range 0 (12:00 A.M.) to 23 (11:00 P.M.).

- Note that Gnumeric will perform regular string to serial number conversion for you, so you can enter a date as a string.

- This function is Excel compatible.

#### Examples

`HOUR`(0.128472) equals 3.

#### See also

`MINUTE`, `NOW`, `TIME`, `SECOND`.

`ISOWEEKNUM`

`ISOWEEKNUM`

    ISOWEEKNUM (date)

#### Description

`ISOWEEKNUM` returns the ISO 8601 week number of `date`.

An ISO 8601 week starts on Monday. Weeks are numbered from 1. A week including days from two different years is assigned to the year which includes the most days. This means that Dec 31 could be in week 1 of the following year, and Jan 1 could be in week 52 or 53 of the previous year. `ISOWEEKNUM` returns the week number.

- `ISOWEEKNUM` returns #NUM! if date is invalid.

#### Examples

If A1 contains 12/21/00 then `ISOWEEKNUM`(A1)=51

#### See also

`WEEKNUM`, `ISOYEAR`.

`ISOYEAR`

`ISOYEAR`

    ISOYEAR (date)

#### Description

`ISOYEAR` returns the year of the ISO 8601 week number of `date`.

An ISO 8601 week starts on Monday. Weeks are numbered from 1. A week including days from two different years is assigned to the year which includes the most days. This means that Dec 31 could be in week 1 of the following year, and Jan 1 could be in week 52 or 53 of the previous year. `ISOYEAR` returns the year the week is assigned to.

- `ISOYEAR` returns #NUM! if date is invalid.

#### Examples

If A1 contains 12/31/2001 then `ISOYEAR`(A1)=2002

#### See also

`ISOWEEKNUM`.

`MINUTE`

`MINUTE`

    MINUTE (date)

#### Description

`MINUTE` converts a serial number to a minute. The minute is returned as an integer in the range 0 to 59.

- Note that Gnumeric will perform regular string to serial number conversion for you, so you can enter a date as a string.

- This function is Excel compatible.

#### Examples

`MINUTE`(0.128472) equals 5.

#### See also

`HOUR`, `NOW`, `TIME`, `SECOND`.

`MONTH`

`MONTH`

    MONTH (date)

#### Description

`MONTH` converts a serial number to a month.

- Note that Gnumeric will perform regular string to serial number conversion for you, so you can enter a date as a string.

- This function is Excel compatible.

#### Examples

`MONTH`(DATE(2003, 4, 30)) equals 4.

#### See also

`DAY`, `TIME`, `NOW`, `YEAR`.

`NETWORKDAYS`

`NETWORKDAYS`

    NETWORKDAYS (start_date,end_date[,holidays])

#### Description

`NETWORKDAYS` returns the number of non-weekend non-holidays between `start_date` and `end_date` including these dates. Holidays are optionally supplied in `holidays`.

- `NETWORKDAYS` returns #NUM! if `start_date` or `end_date` are invalid.

- This function is Excel compatible.

#### Examples

`NETWORKDAYS`(DATE(2001,1,2),DATE(2001,2,15)) equals 33.

#### See also

`WORKDAY`.

`NOW`

`NOW`

    NOW ()

#### Description

`NOW` returns the serial number for the date and time at the time it is evaluated.

Serial Numbers in Gnumeric are represented as follows:The integral part is the number of days since the 1st of January of 1900. The decimal part represent the fraction of the day and is mapped into hour, minutes and seconds.

For example: .0 represents the beginning of the day, and 0.5 represents noon.

- This function is Excel compatible.

#### Examples

`NOW`().

#### See also

`TODAY`.

`SECOND`

`SECOND`

    SECOND (date)

#### Description

`SECOND` converts a serial number to a second. The second is returned as an integer in the range 0 to 59.

- Note that Gnumeric will perform regular string to serial number conversion for you, so you can enter a date as a string.

- This function is Excel compatible.

#### Examples

`SECOND`(0.600613) equals 53.

#### See also

`HOUR`, `MINUTE`, `NOW`, `TIME`.

`TIME`

`TIME`

    TIME (hours,minutes,seconds)

#### Description

`TIME` returns a fraction representing the time of day.

- This function is Excel compatible.

#### Examples

`TIME`(3, 5, 23) equals 3:05AM.

#### See also

`HOUR`.

`TIMEVALUE`

`TIMEVALUE`

    TIMEVALUE (timetext)

#### Description

`TIMEVALUE` returns a fraction representing the time of day, a number between 0 and 1.

- This function is Excel compatible.

#### Examples

`TIMEVALUE`("3:05") equals 0.128472.

`TIMEVALUE`("2:24:53 PM") equals 0.600613.

#### See also

`HOUR`, `MINUTE`.

`TODAY`

`TODAY`

    TODAY()

#### Description

`TODAY` returns the serial number for today (the number of days elapsed since the 1st of January of 1900).

- This function is Excel compatible.

#### Examples

`TODAY`() returns 'Nov 6, 2001' on that particular day.

#### See also

`NOW`.

`UNIX2DATE`

`UNIX2DATE`

    UNIX2DATE(unixtime)

#### Description

`UNIX2DATE` converts a unix time into a spreadsheet date and time.

A unix time is the number of seconds since midnight January 1, 1970.

#### Examples

#### See also

`NOW`, `DATE`, `DATE2UNIX`.

`WEEKDAY`

`WEEKDAY`

    WEEKDAY (date[, method])

#### Description

`WEEKDAY` converts a serial number to a weekday.

This function returns an integer indicating the day of week.

`METHOD` indicates the numbering system. It defaults to 1.

For `METHOD`=1: Sunday is 1, Monday is 2, etc.

For `METHOD`=2: Monday is 1, Tuesday is 2, etc.

For `METHOD`=3: Monday is 0, Tuesday is 1, etc.

- Note that Gnumeric will perform regular string to serial number conversion for you, so you can enter a date as a string.

- This function is Excel compatible.

#### Examples

`WEEKDAY`("10/24/1968") equals 5 (Thursday).

#### See also

`DAY`, `MONTH`, `TIME`, `NOW`, `YEAR`.

`WEEKNUM`

`WEEKNUM`

    WEEKNUM (date[,method])

#### Description

`WEEKNUM` returns the week number of `date` according to the given `method`.

`method` defaults to 1.

For `method`=1, week starts on Sunday, and days before first Sunday are in week 0.

For `method`=2, week starts on Monday, and days before first Monday are in week 0.

For `method`=150, the ISO 8601 week number is returned.

- `WEEKNUM` returns #NUM! if `date` or `method` is invalid.

- This function is Excel compatible, except that Excel does not support ISO 8601 week numbers.

#### Examples

If A1 contains 12/21/00 then `WEEKNUM`(A1,2)=51

#### See also

`ISOWEEKNUM`.

`WORKDAY`

`WORKDAY`

    WORKDAY (start_date,days[,holidays])

#### Description

`WORKDAY` returns the date which is `days` working days from the `start_date`. Weekends and holidays optionally supplied in `holidays` are respected.

- `WORKDAY` returns #NUM! if `start_date` or `days` are invalid.

- This function is Excel compatible.

#### Examples

DAY(`WORKDAY`(DATE(2001,1,5),30)) equals 16 and

MONTH(`WORKDAY`(DATE(2001,1,5),30)) equals 2.

#### See also

`NETWORKDAYS`.

`YEAR`

`YEAR`

    YEAR (date)

#### Description

`YEAR` converts a serial number to a year.

- Note that Gnumeric will perform regular string to serial number conversion for you, so you can enter a date as a string.

- This function is Excel compatible.

#### Examples

`YEAR`(DATE(2003, 4, 30)) equals 2003.

#### See also

`DAY`, `MONTH`, `TIME`, `NOW`.

`YEARFRAC`

`YEARFRAC`

    YEARFRAC (start_date, end_date [,basis])

#### Description

`YEARFRAC` returns the number of full days between `start_date` and `end_date` according to the `basis`.

#### Examples

#### See also

`DATEDIF`.

## Engineering

`BASE`

`BASE`

    BASE(number,base[,length])

#### Description

`BASE` function converts a number to a string representing that number in base `base`.

- `base` must be an integer between 2 and 36.

- This function is OpenOffice.Org compatible.

- Optional argument `length` specifies the minimum result length. Leading zeroes will be added to reach this length.

#### Examples

`BASE`(255,16,4) equals "00FF".

#### See also

`DECIMAL`.

`BESSELI`

`BESSELI`

    BESSELI(x,y)

#### Description

`BESSELI` function returns the Neumann, Weber or Bessel function.

`x` is where the function is evaluated. `y` is the order of the Bessel function, if non-integer it is truncated.

- If `x` or `y` are not numeric a #VALUE! error is returned.

- If `y` < 0 a #NUM! error is returned.

- This function is Excel compatible.

#### Examples

`BESSELI`(0.7,3) equals 0.007367374.

#### See also

`BESSELJ`, `BESSELK`, `BESSELY`.

`BESSELJ`

`BESSELJ`

    BESSELJ(x,y)

#### Description

`BESSELJ` function returns the Bessel function with `x` is where the function is evaluated. `y` is the order of the Bessel function, if non-integer it is truncated.

- If `x` or `y` are not numeric a #VALUE! error is returned.

- If `y` < 0 a #NUM! error is returned.

- This function is Excel compatible.

#### Examples

`BESSELJ`(0.89,3) equals 0.013974004.

#### See also

`BESSELI`, `BESSELK`, `BESSELY`.

`BESSELK`

`BESSELK`

    BESSELK(x,y)

#### Description

`BESSELK` function returns the Neumann, Weber or Bessel function. `x` is where the function is evaluated. `y` is the order of the Bessel function, if non-integer it is truncated.

- If `x` or `y` are not numeric a #VALUE! error is returned.

- If `y` < 0 a #NUM! error is returned.

- This function is Excel compatible.

#### Examples

`BESSELK`(3,9) equals 397.95880.

#### See also

`BESSELI`, `BESSELJ`, `BESSELY`.

`BESSELY`

`BESSELY`

    BESSELY(x,y)

#### Description

`BESSELY` function returns the Neumann, Weber or Bessel function.

`x` is where the function is evaluated. `y` is the order of the Bessel function, if non-integer it is truncated.

- If `x` or `y` are not numeric a #VALUE! error is returned.

- If `y` < 0 a #NUM! error is returned.

- This function is Excel compatible.

#### Examples

`BESSELY`(4,2) equals 0.215903595.

#### See also

`BESSELI`, `BESSELJ`, `BESSELK`.

`BIN2DEC`

`BIN2DEC`

    BIN2DEC(x)

#### Description

`BIN2DEC` function converts a binary number in string or number to its decimal equivalent.

- This function is Excel compatible.

#### Examples

`BIN2DEC`(101) equals 5.

#### See also

`DEC2BIN`, `BIN2OCT`, `BIN2HEX`.

`BIN2HEX`

`BIN2HEX`

    BIN2HEX(number[,places])

#### Description

`BIN2HEX` function converts a binary number to a hexadecimal number. `places` is an optional field, specifying to zero pad to that number of spaces.

- If `places` is too small or negative #NUM! error is returned.

- This function is Excel compatible.

#### Examples

`BIN2HEX`(100111) equals 27.

#### See also

`HEX2BIN`, `BIN2OCT`, `BIN2DEC`.

`BIN2OCT`

`BIN2OCT`

    BIN2OCT(number[,places])

#### Description

`BIN2OCT` function converts a binary number to an octal number. `places` is an optional field, specifying to zero pad to that number of spaces.

- If `places` is too small or negative #NUM! error is returned.

- This function is Excel compatible.

#### Examples

`BIN2OCT`(110111) equals 67.

#### See also

`OCT2BIN`, `BIN2DEC`, `BIN2HEX`.

`CONVERT`

`CONVERT`

    CONVERT(number,from_unit,to_unit)

#### Description

`CONVERT` returns a conversion from one measurement system to another. For example, you can convert a weight in pounds to a weight in grams. `number` is the value you want to convert, `from_unit` specifies the unit of the `number`, and `to_unit` is the unit for the result.

`from_unit` and `to_unit` can be any of the following:

Weight and mass:

'g' Gram

'sg' Slug

'lbm' Pound

'u' U (atomic mass)

'ozm' Ounce

Distance:

'm' Meter

'mi' Statute mile

'Nmi' Nautical mile

'in' Inch

'ft' Foot

'yd' Yard

'ang' Angstrom

'Pica' Pica

Time:

'yr' Year

'day' Day

'hr' Hour

'mn' Minute

'sec' Second

Pressure:

'Pa' Pascal

'atm' Atmosphere

'mmHg' mm of Mercury

Force:

'N' Newton

'dyn' Dyne

'lbf' Pound force

Energy:

'J' Joule

'e' Erg

'c' Thermodynamic calorie

'cal' IT calorie

'eV' Electron volt

'HPh' Horsepower-hour

'Wh' Watt-hour

'flb' Foot-pound

'BTU' BTU

Power:

'HP' Horsepower

'W' Watt

Magnetism:

'T' Tesla

'ga' Gauss

Temperature:

'C' Degree Celsius

'F' Degree Fahrenheit

'K' Degree Kelvin

Liquid measure:

'tsp' Teaspoon

'tbs' Tablespoon

'oz' Fluid ounce

'cup' Cup

'pt' Pint

'qt' Quart

'gal' Gallon

'l' Liter

For metric units any of the following prefixes can be used:

'Y' yotta 1E+24

'Z' zetta 1E+21

'E' exa 1E+18

'P' peta 1E+15

'T' tera 1E+12

'G' giga 1E+09

'M' mega 1E+06

'k' kilo 1E+03

'h' hecto 1E+02

'e' deka 1E+01

'd' deci 1E-01

'c' centi 1E-02

'm' milli 1E-03

'u' micro 1E-06

'n' nano 1E-09

'p' pico 1E-12

'f' femto 1E-15

'a' atto 1E-18

'z' zepto 1E-21

'y' yocto 1E-24

- If `from_unit` and `to_unit` are different types, `CONVERT` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`CONVERT`(3,"lbm","g") equals 1360.7769.

`CONVERT`(5.8,"m","in") equals 228.3465.

`CONVERT`(7.9,"cal","J") equals 33.07567.

#### See also

`DEC2BIN`

`DEC2BIN`

    DEC2BIN(number[,places])

#### Description

`DEC2BIN` function converts a decimal number to a binary number. `places` is an optional field, specifying to zero pad to that number of spaces.

- If `places` is too small or negative #NUM! error is returned.

- This function is Excel compatible.

#### Examples

`DEC2BIN`(42) equals 101010.

#### See also

`BIN2DEC`, `DEC2OCT`, `DEC2HEX`.

`DEC2HEX`

`DEC2HEX`

    DEC2HEX(number[,places])

#### Description

`DEC2HEX` function converts a decimal number to a hexadecimal number. `places` is an optional field, specifying to zero pad to that number of spaces.

- If `places` is too small or negative #NUM! error is returned.

- This function is Excel compatible.

#### Examples

`DEC2HEX`(42) equals 2A.

#### See also

`HEX2DEC`, `DEC2BIN`, `DEC2OCT`.

`DEC2OCT`

`DEC2OCT`

    DEC2OCT(number[,places])

#### Description

`DEC2OCT` function converts a decimal number to an octal number. `places` is an optional field, specifying to zero pad to that number of spaces.

- If `places` is too small or negative #NUM! error is returned.

- This function is Excel compatible.

#### Examples

`DEC2OCT`(42) equals 52.

#### See also

`OCT2DEC`, `DEC2BIN`, `DEC2HEX`.

`DECIMAL`

`DECIMAL`

    DECIMAL(text,base)

#### Description

`DECIMAL` function converts a number in base `base` to decimal.

- `base` must be an integer between 2 and 36.

- This function is OpenOffice.Org compatible.

#### Examples

`DECIMAL`("A1",16) equals 161.

#### See also

`BASE`.

`DELTA`

`DELTA`

    DELTA(x[,y])

#### Description

`DELTA` function tests for numerical equivalence of two arguments, returning 1 in case of equality.

- `y` is optional, and defaults to 0.

- If either argument is non-numeric returns a #VALUE! error.

- This function is Excel compatible.

#### Examples

`DELTA`(42.99,43) equals 0.

#### See also

`EXACT`, `GESTEP`.

`ERF`

`ERF`

    ERF([lower limit,]upper_limit)

#### Description

`ERF` returns the error function. With a single argument `ERF` returns the error function, defined as

erf(x) = 2/sqrt(pi)* integral from 0 to x of exp(-t*t) dt.

If two arguments are supplied, they are the lower and upper limits of the integral.

- If either `lower_limit` or `upper_limit` is not numeric a #VALUE! error is returned.

- This function is upward-compatible with that in Excel. (If two arguments are supplied, Excel will not allow either to be negative.)

#### Examples

`ERF`(0.4) equals 0.428392355.

`ERF`(1.6448536269515/SQRT(2)) equals 0.90.

The second example shows that a random variable with a normal distribution has a 90 percent chance of falling within approximately 1.645 standard deviations of the mean.

#### See also

`ERFC`.

`ERFC`

`ERFC`

    ERFC(x)

#### Description

`ERFC` function returns the complementary error function, defined as

1 - erf(x).

erfc(x) is calculated more accurately than 1 - erf(x) for arguments larger than about 0.5.

- If `x` is not numeric a #VALUE! error is returned.

#### Examples

`ERFC`(6) equals 2.15197367e-17.

#### See also

`ERF`.

`GESTEP`

`GESTEP`

    GESTEP(x[,y])

#### Description

`GESTEP` function test for if `x` is >= `y`, returning 1 if it is so, and 0 otherwise. `y` is optional, and defaults to 0.

- If either argument is non-numeric returns a #VALUE! error.

- This function is Excel compatible.

#### Examples

`GESTEP`(5,4) equals 1.

#### See also

`DELTA`.

`HEX2BIN`

`HEX2BIN`

    HEX2BIN(number[,places])

#### Description

`HEX2BIN` function converts a hexadecimal number to a binary number. `places` is an optional field, specifying to zero pad to that number of spaces.

- If `places` is too small or negative #NUM! error is returned.

- This function is Excel compatible.

#### Examples

`HEX2BIN`("2A") equals 101010.

#### See also

`BIN2HEX`, `HEX2OCT`, `HEX2DEC`.

`HEX2DEC`

`HEX2DEC`

    HEX2DEC(x)

#### Description

`HEX2DEC` function converts a hexadecimal number to its decimal equivalent.

- This function is Excel compatible.

#### Examples

`HEX2DEC`("2A") equals 42.

#### See also

`DEC2HEX`, `HEX2BIN`, `HEX2OCT`.

`HEX2OCT`

`HEX2OCT`

    HEX2OCT(number[,places])

#### Description

`HEX2OCT` function converts a hexadecimal number to an octal number. `places` is an optional field, specifying to zero pad to that number of spaces.

- If `places` is too small or negative #NUM! error is returned.

- This function is Excel compatible.

#### Examples

`HEX2OCT`("2A") equals 52.

#### See also

`OCT2HEX`, `HEX2BIN`, `HEX2DEC`.

`INVSUMINV`

`INVSUMINV`

    INVSUMINV(x1,x2,...)

#### Description

`INVSUMINV` sum calculates the inverse of the sum of inverses.

The primary use of this is for calculating equivalent resistance for parallel resistors or equivalent capacitance of a series of capacitors.

- All arguments must be non-negative, or else a #VALUE! result is returned.

- If any argument is zero, the result is zero.

#### Examples

`INVSUMINV`(2000,2000) equals 1000.

#### See also

`HARMEAN`.

`OCT2BIN`

`OCT2BIN`

    OCT2BIN(number[,places])

#### Description

`OCT2BIN` function converts an octal number to a binary number. `places` is an optional field, specifying to zero pad to that number of spaces.

- If `places` is too small or negative #NUM! error is returned.

- This function is Excel compatible.

#### Examples

`OCT2BIN`("213") equals 10001011.

#### See also

`BIN2OCT`, `OCT2DEC`, `OCT2HEX`.

`OCT2DEC`

`OCT2DEC`

    OCT2DEC(x)

#### Description

`OCT2DEC` function converts an octal number in a string or number to its decimal equivalent.

- This function is Excel compatible.

#### Examples

`OCT2DEC`("124") equals 84.

#### See also

`DEC2OCT`, `OCT2BIN`, `OCT2HEX`.

`OCT2HEX`

`OCT2HEX`

    OCT2HEX(number[,places])

#### Description

`OCT2HEX` function converts an octal number to a hexadecimal number. `places` is an optional field, specifying to zero pad to that number of spaces.

- If `places` is too small or negative #NUM! error is returned.

- This function is Excel compatible.

#### Examples

`OCT2HEX`(132) equals 5A.

#### See also

`HEX2OCT`, `OCT2BIN`, `OCT2DEC`.

## Erlang

`DIMCIRC`

`DIMCIRC`

    DIMCIRC(traffic,gos)

#### Description

`DIMCIRC` returns a number of circuits required from a number of `traffic` loads with `gos` grade of service.

#### Examples

`DIMCIRC`(24,1%) returns 35.

#### See also

`OFFCAP`, `OFFTRAF`, `PROBBLOCK`.

`OFFCAP`

`OFFCAP`

    OFFCAP(circuits,gos)

#### Description

`OFFCAP` returns a number of traffic capacity given by a number of `circuits` with `gos` grade of service.

#### Examples

`OFFCAP`(30,1%) returns 20.337.

#### See also

`DIMCIRC`, `OFFTRAF`, `PROBBLOCK`.

`OFFTRAF`

`OFFTRAF`

    OFFTRAF(traffic,circuits)

#### Description

`OFFTRAF` returns a predicted number of offered traffic from a number of carried `traffic` (taken from measurements) on a number of `circuits`.

- `traffic` cannot exceed `circuits`

#### Examples

`OFFTRAF`(24,30) returns 25.527.

#### See also

`PROBBLOCK`, `DIMCIRC`, `OFFCAP`.

`PROBBLOCK`

`PROBBLOCK`

    PROBBLOCK(traffic,circuits)

#### Description

`PROBBLOCK` returns probability of blocking when a number of `traffic` loads into a number of `circuits` (servers).

- `traffic` cannot exceed `circuits`

#### Examples

`PROBBLOCK`(24,30) returns 0.4012.

#### See also

`OFFTRAF`, `DIMCIRC`, `OFFCAP`.

## Finance

`ACCRINT`

`ACCRINT`

    ACCRINT(issue,first_interest,settlement,rate,par,frequency[,basis])

#### Description

`ACCRINT` calculates the accrued interest for a security that pays periodic interest.

`issue` is the issue date of the security. `first_interest` is the first interest date of the security. `settlement` is the settlement date of the security. The settlement date is always after the issue date (the date when the security is bought). `rate` is the annual rate of the security and `par` is the par value of the security. `frequency` is the number of coupon payments per year.

Allowed frequencies are:

1 = annual,

2 = semi,

4 = quarterly.

`basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `issue` date, `first_interest` date, or `settlement` date is not valid, `ACCRINT` returns #NUM! error.

- The dates must be `issue` < `first_interest` < `settlement`, or `ACCRINT` returns #NUM! error.

- If `rate` <= 0 or `par` <= 0 , `ACCRINT` returns #NUM! error.

- If `basis` is omitted, US 30/360 is applied.

- If `basis` < 0 or `basis` > 4, `ACCRINT` returns #NUM! error.

- If `issue` date is after `settlement` date or they are the same, `ACCRINT` returns #NUM! error.

#### Examples

#### See also

`ACCRINTM`.

`ACCRINTM`

`ACCRINTM`

    ACCRINTM(issue,maturity,rate[,par,basis])

#### Description

`ACCRINTM` calculates and returns the accrued interest for a security from `issue` to `maturity` date.

`issue` is the issue date of the security. `maturity` is the maturity date of the security. `rate` is the annual rate of the security and `par` is the par value of the security. If you omit `par`, `ACCRINTM` applies $1,000 instead. `basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `issue` date or `maturity` date is not valid, `ACCRINTM` returns #NUM! error.

- If `rate` <= 0 or `par` <= 0, `ACCRINTM` returns #NUM! error.

- If `basis` is omitted, US 30/360 is applied.

- If `basis` < 0 or `basis` > 4, `ACCRINTM` returns #NUM! error.

- If `issue` date is after `maturity` date or they are the same, `ACCRINTM` returns #NUM! error.

#### Examples

#### See also

`ACCRINT`.

`AMORDEGRC`

`AMORDEGRC`

    AMORDEGRC(cost,purchase_date,first_period,salvage,period,rate[,basis])

#### Description

`AMORDEGRC`: Calculates depreciation for each accounting period using French accounting conventions. Assets purchased in the middle of a period take prorated depreciation into account. This is similar to AMORLINC, except that a depreciation coefficient is applied in the calculation depending on the life of the assets.

Named for AMORtissement DEGRessif Comptabilite

`cost` The value of the asset.

`purchase_date` The date the asset was purchased.

`first_period` The end of the first period.

`salvage` Asset value at maturity.

`period` The length of accounting periods.

`rate` rate of depreciation as a percentage.

`basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `basis` is omitted, US 30/360 is applied.

- If `basis` is not in between 0 and 4, #NUM! error is returned.

#### Examples

`AMORDEGRC`(2400,DATE(1998,8,19),DATE(1998,12,30),300,1,0.14,1) = 733

#### See also

`AMORLINC`.

`AMORLINC`

`AMORLINC`

    AMORLINC(cost,purchase_date,first_period,salvage,period,rate[,basis])

#### Description

`AMORLINC`: Calculates depreciation for each accounting period using French accounting conventions. Assets purchased in the middle of a period take prorated depreciation into account.

Named for AMORtissement LINeaire Comptabilite.

`cost` The value of the asset.

`purchase_date` The date the asset was purchased.

`first_period` The end of the first period.

`salvage` Asset value at maturity.

`period` The length of accounting periods.

`rate` rate of depreciation as a percentage.

`basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `basis` is omitted, US 30/360 is applied.

- If `basis` is not in between 0 and 4, #NUM! error is returned.

#### Examples

`AMORLINC`(2400,DATE(1998,8,19),DATE(1998,12,31),300,1,0.15,1) = 360

#### See also

`AMORDEGRC`.

`COUPDAYBS`

`COUPDAYBS`

    COUPDAYBS(settlement,maturity,frequency[,basis,eom])

#### Description

`COUPDAYBS` returns the number of days from the beginning of the coupon period to the settlement date.

`settlement` is the settlement date of the security.

`maturity` is the maturity date of the security.

`frequency` is the number of coupon payments per year.

`eom` = TRUE handles end of month maturity dates special.

Allowed frequencies are: 1 = annual, 2 = semi, 4 = quarterly, 6 = bimonthly, 12 = monthly.

`basis` is the type of day counting system you want to use:

0 MSRB 30/360 (MSRB Rule G33 (e))

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

5 European+ 30/360

(See the gnumeric manual for a detailed description of these bases).

- If `frequency` is invalid, `COUPDAYBS` returns #NUM! error.

- If `basis` is omitted, MSRB 30/360 is applied.

- If `basis` is invalid, #NUM! error is returned.

#### Examples

`COUPDAYBS` (DATE(2002,11,29),DATE(2004,2,29),4,0) = 89

`COUPDAYBS` (DATE(2002,11,29),DATE(2004,2,29),4,0,FALSE) = 0

#### See also

`COUPDAYS`

`COUPDAYS`

    COUPDAYS(settlement,maturity,frequency[,basis,eom])

#### Description

`COUPDAYS` returns the number of days in the coupon period of the settlement date.

`settlement` is the settlement date of the security.

`maturity` is the maturity date of the security.

`frequency` is the number of coupon payments per year.

`eom` = TRUE handles end of month maturity dates special.

Allowed frequencies are: 1 = annual, 2 = semi, 4 = quarterly, 6 = bimonthly, 12 = monthly.

`basis` is the type of day counting system you want to use:

0 MSRB 30/360 (MSRB Rule G33 (e))

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

5 European+ 30/360

(See the gnumeric manual for a detailed description of these bases).

- If `frequency` is invalid, `COUPDAYS` returns #NUM! error.

- If `basis` is omitted, MSRB 30/360 is applied.

- If `basis` is invalid, #NUM! error is returned.

#### Examples

`COUPDAYS` (DATE(2002,11,29),DATE(2004,2,29),4,0) = 90

`COUPDAYS` (DATE(2002,11,29),DATE(2004,2,29),4,0,FALSE) = 90

`COUPDAYS` (DATE(2002,11,29),DATE(2004,2,29),4,1,FALSE) = 91

#### See also

`COUPDAYSNC`

`COUPDAYSNC`

    COUPDAYSNC(settlement,maturity,frequency[,basis,eom])

#### Description

`COUPDAYSNC` returns the number of days from the settlement date to the next coupon date.

`settlement` is the settlement date of the security.

`maturity` is the maturity date of the security.

`frequency` is the number of coupon payments per year.

`eom` = TRUE handles end of month maturity dates special.

Allowed frequencies are: 1 = annual, 2 = semi, 4 = quarterly, 6 = bimonthly, 12 = monthly.

`basis` is the type of day counting system you want to use:

0 MSRB 30/360 (MSRB Rule G33 (e))

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

5 European+ 30/360

(See the gnumeric manual for a detailed description of these bases).

- If `frequency` is invalid, `COUPDAYSNC` returns #NUM! error.

- If `basis` is omitted, MSRB 30/360 is applied.

- If `basis` is invalid, #NUM! error is returned.

#### Examples

`COUPDAYSNC` (DATE(2002,11,29),DATE(2004,2,29),4,0) = 1

`COUPDAYSNC` (DATE(2002,11,29),DATE(2004,2,29),4,0,FALSE) = 89

#### See also

`COUPNCD`

`COUPNCD`

    COUPNCD(settlement,maturity,frequency[,basis,eom])

#### Description

`COUPNCD` returns the coupon date following settlement.

`settlement` is the settlement date of the security.

`maturity` is the maturity date of the security.

`frequency` is the number of coupon payments per year.

`eom` = TRUE handles end of month maturity dates special.

Allowed frequencies are: 1 = annual, 2 = semi, 4 = quarterly, 6 = bimonthly, 12 = monthly.

`basis` is the type of day counting system you want to use:

0 MSRB 30/360 (MSRB Rule G33 (e))

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

5 European+ 30/360

(See the gnumeric manual for a detailed description of these bases).

- If `frequency` is invalid, `COUPNCD` returns #NUM! error.

- If `basis` is omitted, MSRB 30/360 is applied.

- If `basis` is invalid, #NUM! error is returned.

#### Examples

`COUPNCD` (DATE(2002,11,29),DATE(2004,2,29),4,0) = 30-Nov-2002

`COUPNCD` (DATE(2002,11,29),DATE(2004,2,29),4,0,FALSE) = 28-Feb-2003

#### See also

`COUPNUM`

`COUPNUM`

    COUPNUM(settlement,maturity,frequency[,basis,eom])

#### Description

`COUPNUM` returns the numbers of coupons to be paid between the settlement and maturity dates, rounded up.

`settlement` is the settlement date of the security.

`maturity` is the maturity date of the security.

`frequency` is the number of coupon payments per year.

`eom` = TRUE handles end of month maturity dates special.

Allowed frequencies are: 1 = annual, 2 = semi, 4 = quarterly. 6 = bimonthly, 12 = monthly.

`basis` is the type of day counting system you want to use:

0 MSRB 30/360 (MSRB Rule G33 (e))

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

5 European+ 30/360

- If `frequency` is other than 1, 2, 4, 6 or 12, `COUPNUM` returns #NUM! error.

- If `basis` is omitted, MSRB 30/360 is applied.

- If `basis` is not in between 0 and 5, #NUM! error is returned.

#### Examples

`COUPNUM` (DATE(2002,11,29),DATE(2004,2,29),4,0) = 6

`COUPNUM` (DATE(2002,11,29),DATE(2004,2,29),4,0,FALSE) = 5

#### See also

`COUPPCD`

`COUPPCD`

    COUPPCD(settlement,maturity,frequency[,basis,eom])

#### Description

`COUPPCD` returns the coupon date preceding settlement.

`settlement` is the settlement date of the security.

`maturity` is the maturity date of the security.

`frequency` is the number of coupon payments per year.

`eom` = TRUE handles end of month maturity dates special.

Allowed frequencies are: 1 = annual, 2 = semi, 4 = quarterly, 6 = bimonthly, 12 = monthly.

`basis` is the type of day counting system you want to use:

0 MSRB 30/360 (MSRB Rule G33 (e))

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

5 European+ 30/360

(See the gnumeric manual for a detailed description of these bases).

- If `frequency` is invalid, `COUPPCD` returns #NUM! error.

- If `basis` is omitted, MSRB 30/360 is applied.

- If `basis` is invalid, #NUM! error is returned.

#### Examples

`COUPPCD` (DATE(2002,11,29),DATE(2004,2,29),4,0) = 31-Aug-2002

`COUPPCD` (DATE(2002,11,29),DATE(2004,2,29),4,0,FALSE) = 29-Nov-2002

#### See also

`CUM_BIV_NORM_DIST`

`CUM_BIV_NORM_DIST`

    CUM_BIV_NORM_DIST(a,b,rho)

#### Description

`CUM_BIV_NORM_DIST` calculates the cumulative bivariate normal distribution from parameters a, b & rho.

The return value is the probability that two random variables with correlation `rho` are respectively each less than `a` and `b`.

#### Examples

#### See also

`NORMDIST`, `NORMSDIST`, `NORMSINV`.

`CUMIPMT`

`CUMIPMT`

    CUMIPMT(rate,nper,pv,start_period,end_period,type)

#### Description

`CUMIPMT` returns the cumulative interest paid on a loan between `start_period` and `end_period`.

- If `rate` <= 0, `CUMIPMT` returns #NUM! error.

- If `nper` <= 0, `CUMIPMT` returns #NUM! error.

- If `pv` <= 0, `CUMIPMT` returns #NUM! error.

- If `start_period` < 1, `CUMIPMT` returns #NUM! error.

- If `end_period` < `start_period`, `CUMIPMT` returns #NUM! error.

- If `end_period` > `nper`, `CUMIPMT` returns #NUM! error.

- If `type` <> 0 and `type` <> 1, `CUMIPMT` returns #NUM! error.

#### Examples

#### See also

`CUMPRINC`

`CUMPRINC`

    CUMPRINC(rate,nper,pv,start_period,end_period,type)

#### Description

`CUMPRINC` returns the cumulative principal paid on a loan between `start_period` and `end_period`.

- If `rate` <= 0, `CUMPRINC` returns #NUM! error.

- If `nper` <= 0, `CUMPRINC` returns #NUM! error.

- If `pv` <= 0, `CUMPRINC` returns #NUM! error.

- If `start_period` < 1, `CUMPRINC` returns #NUM! error.

- If `end_period` < `start_period`, `CUMPRINC` returns #NUM! error.

- If `end_period` > `nper`, `CUMPRINC` returns #NUM! error.

- If `type` <> 0 and `type` <> 1, `CUMPRINC` returns #NUM! error.

#### Examples

#### See also

`DB`

`DB`

    DB(cost,salvage,life,period[,month])

#### Description

`DB` calculates the depreciation of an asset for a given period using the fixed-declining balance method. `cost` is the initial value of the asset. `salvage` is the value after the depreciation.

`life` is the number of periods overall. `period` is the period for which you want the depreciation to be calculated. `month` is the number of months in the first year of depreciation.

- If `month` is omitted, it is assumed to be 12.

- If `cost` = 0, `DB` returns #NUM! error.

- If `life` <= 0, `DB` returns #NUM! error.

- If `salvage` / `cost` < 0, `DB` returns #NUM! error.

#### Examples

#### See also

`DDB`, `SLN`, `SYD`.

`DDB`

`DDB`

    DDB(cost,salvage,life,period[,factor])

#### Description

`DDB` returns the depreciation of an asset for a given period using the double-declining balance method or some other similar method you specify.

`cost` is the initial value of the asset, `salvage` is the value after the last period, `life` is the number of periods, `period` is the period for which you want the depreciation to be calculated, and `factor` is the factor at which the balance declines.

- If `factor` is omitted, it is assumed to be two (double-declining balance method).

- If `life` <= 0, `DDB` returns #NUM! error.

#### Examples

#### See also

`SLN`, `SYD`.

`DISC`

`DISC`

    DISC(settlement,maturity,par,redemption[,basis])

#### Description

`DISC` calculates and returns the discount rate for a security. `settlement` is the settlement date of the security.

`maturity` is the maturity date of the security. `par` is the price per $100 face value of the security. `redemption` is the redemption value per $100 face value of the security.

`basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `settlement` date or `maturity` date is not valid, `DISC` returns #NUM! error.

- If `basis` is omitted, US 30/360 is applied.

- If `basis` < 0 or `basis` > 4, `DISC` returns #NUM! error.

- If `settlement` date is after `maturity` date or they are the same, `DISC` returns #NUM! error.

#### Examples

#### See also

`DOLLARDE`

`DOLLARDE`

    DOLLARDE(fractional_dollar,fraction)

#### Description

`DOLLARDE` converts a dollar price expressed as a fraction into a dollar price expressed as a decimal number.

`fractional_dollar` is the fractional number to be converted. `fraction` is the denominator of the fraction.

- If `fraction` is non-integer it is truncated.

- If `fraction` <= 0, `DOLLARDE` returns #NUM! error.

#### Examples

#### See also

`DOLLARFR`.

`DOLLARFR`

`DOLLARFR`

    DOLLARFR(decimal_dollar,fraction)

#### Description

`DOLLARFR` converts a decimal dollar price into a dollar price expressed as a fraction.

- If `fraction` is non-integer it is truncated.

- If `fraction` <= 0, `DOLLARFR` returns #NUM! error.

#### Examples

#### See also

`DOLLARDE`.

`DURATION`

`DURATION`

    DURATION(settlement,maturity,coup,yield,frequency[,basis])

#### Description

`DURATION` calculates the duration of a security.

`settlement` is the settlement date of the security.

`maturity` is the maturity date of the security.

`coup` The annual coupon rate as a percentage.

`yield` The annualized yield of the security as a percentage.

`frequency` is the number of coupon payments per year. Allowed frequencies are: 1 = annual, 2 = semi, 4 = quarterly. `basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `frequency` is other than 1, 2, or 4, `DURATION` returns #NUM! error.

- If `basis` is omitted, US 30/360 is applied.

- If `basis` is not in between 0 and 4, #NUM! error is returned.

#### Examples

#### See also

`G_DURATION`, `MDURATION`.

`EFFECT`

`EFFECT`

    EFFECT(r,nper)

#### Description

`EFFECT` calculates the effective interest rate from a given nominal rate.

Effective interest rate is calculated using this formula:

(1 + `r` / `nper`) ^ `nper` - 1

where:

`r` = nominal interest rate (stated in yearly terms)

`nper` = number of periods used for compounding

- If `rate` < 0, `EFFECT` returns #NUM! error.

- If `nper` <= 0, `EFFECT` returns #NUM! error.

#### Examples

For example credit cards will list an APR (annual percentage rate) which is a nominal interest rate.

For example if you wanted to find out how much you are actually paying interest on your credit card that states an APR of 19% that is compounded monthly you would type in:

=`EFFECT`(.19,12) and you would get .2075 or 20.75%. That is the effective percentage you will pay on your loan.

#### See also

`NOMINAL`.

`EURO`

`EURO`

    EURO(currency)

#### Description

`EURO` converts one Euro to a given national currency in the European monetary union.

`currency` is one of the following:

ATS (Austria)

BEF (Belgium)

DEM (Germany)

ESP (Spain)

EUR (Euro)

FIM (Finland)

FRF (France)

GRD (Greek)

IEP (Ireland)

ITL (Italy)

LUF (Luxembourg)

NLG (Netherlands)

PTE (Portugal)

- If the given `currency` is other than one of the above, `EURO` returns #NUM! error.

#### Examples

`EURO`("DEM") returns 1.95583.

#### See also

`EUROCONVERT`

`EUROCONVERT`

    EUROCONVERT(n,source,target)

#### Description

`EUROCONVERT` converts the currency value `n` of `source` currency to a target currency `target`. Both currencies are given as three-letter strings using the ISO code system names. The following currencies are available:

ATS (Austria)

BEF (Belgium)

DEM (Germany)

ESP (Spain)

EUR (Euro)

FIM (Finland)

FRF (France)

GRD (Greek)

IEP (Ireland)

ITL (Italy)

LUF (Luxembourg)

NLG (Netherlands)

PTE (Portugal)

- If the given `source` or `target` is other than one of the above, `EUROCONVERT` returns #VALUE! error.

#### Examples

`EUROCONVERT`(2.1,"DEM","EUR") returns 1.07.

#### See also

`EURO`.

`FV`

`FV`

    FV(rate,nper,pmt[,pv,type])

#### Description

`FV` computes the future value of an investment. This is based on periodic, constant payments and a constant interest rate. The interest rate per period is `rate`, `nper` is the number of periods in an annuity, `pmt` is the payment made each period, `pv` is the present value and `type` is when the payment is made.

- If `type` = 1 then the payment is made at the beginning of the period.

- If `type` = 0 it is made at the end of each period.

#### Examples

#### See also

`PV`, `PMT`, `PPMT`.

`FVSCHEDULE`

`FVSCHEDULE`

    FVSCHEDULE(principal,schedule)

#### Description

`FVSCHEDULE` returns the future value of given initial value after applying a series of compound periodic interest rates. The argument `principal` is the present value; `schedule` is an array of interest rates to apply. The `schedule` argument must be a range of cells.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain interest rates 0.11, 0.13, 0.09, 0.17, and 0.03. Then

`FVSCHEDULE`(3000,A1:A5) equals 4942.7911611.

#### See also

`PV`, `FV`.

`G_DURATION`

`G_DURATION`

    G_DURATION(rate,pv,fv)

#### Description

`G_DURATION` calculates number of periods needed for an investment to attain a desired value. This function is similar to FV and PV with a difference that we do not need give the direction of cash flows e.g. -100 for a cash outflow and +100 for a cash inflow.

- If `rate` <= 0, `G_DURATION` returns #DIV0 error.

- If `fv` = 0 or `pv` = 0, `G_DURATION` returns #DIV0 error.

- If `fv` / `pv` < 0, `G_DURATION` returns #VALUE error.

#### Examples

#### See also

`PPMT`, `PV`, `FV`, `DURATION`, `MDURATION`.

`INTRATE`

`INTRATE`

    INTRATE(settlement,maturity,investment,redemption[,basis])

#### Description

`INTRATE` calculates and returns the interest rate of a fully vested security.

`settlement` is the settlement date of the security. `maturity` is the maturity date of the security. `investment` is the prize of the security paid at `settlement` date and `redemption` is the amount to be received at `maturity` date.

`basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `settlement` date or `maturity` date is not valid, `INTRATE` returns #NUM! error.

- If `basis` is omitted, US 30/360 is applied.

- If `basis` < 0 or `basis` > 4, `INTRATE` returns #NUM! error.

- If `settlement` date is after `maturity` date or they are the same, `INTRATE` returns #NUM! error.

#### Examples

If you had a bond with a settlement date of April 15, 2000, maturity date September 30, 2000, investment of $100,000, redemption value $103,525, using the actual/actual basis, the bond discount rate is:

=`INTRATE`(36631, 36799, 100000, 103525, 1) which equals 0.0648 or 6.48%

#### See also

`RECEIVED`, `DATE`.

`IPMT`

`IPMT`

    IPMT(rate,per,nper,pv[,fv,type])

#### Description

`IPMT` calculates the amount of a payment of an annuity going towards interest.

Formula for `IPMT` is:

`IPMT`(PER) = -PRINCIPAL(PER-1) * INTEREST_RATE

where:

PRINCIPAL(PER-1) = amount of the remaining principal from last period

- If `fv` is omitted, it is assumed to be 0.

- If `type` is omitted, it is assumed to be 0.

#### Examples

#### See also

`PPMT`, `PV`, `FV`.

`IRR`

`IRR`

    IRR(values[,guess])

#### Description

`IRR` calculates and returns the internal rate of return of an investment. This function is closely related to the net present value function (NPV). The `IRR` is the interest rate for a series of cash flows where the net preset value is zero.

`values` contains the series of cash flows generated by the investment. The payments should occur at regular intervals. The optional `guess` is the initial value used in calculating the `IRR`. You do not have to use that, it is only provided for the Excel compatibility.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1:A8 contain the numbers -32432, 5324, 7432, 9332, 12324, 4334, 1235, -3422. Then

`IRR`(A1:A8) returns 0.04375.

#### See also

`FV`, `NPV`, `PV`.

`ISPMT`

`ISPMT`

    ISPMT(rate,per,nper,pv)

#### Description

`ISPMT` function returns the interest paid on a given period.

- If `per` < 1 or `per` > `nper`, `ISPMT` returns #NUM! error.

#### Examples

#### See also

`PV`.

`MDURATION`

`MDURATION`

    MDURATION(settlement,maturity,coupon,yield,frequency[,basis])

#### Description

`MDURATION` returns the Macauley duration for a security with par value 100.

`basis` is the type of day counting system you want to use:

0 MSRB 30/360 (MSRB Rule G33 (e))

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

5 European+ 30/360

- If `settlement` or `maturity` are not valid dates, `MDURATION` returns #NUM! error.

- If `frequency` is other than 1, 2, or 4, `MDURATION` returns #NUM! error.

- If `basis` is omitted, MSRB 30/360 is applied.

- If `basis` is invalid, #NUM! error is returned.

#### Examples

#### See also

`DURATION`, `G_DURATION`.

`MIRR`

`MIRR`

    MIRR(values,finance_rate,reinvest_rate)

#### Description

`MIRR` function returns the modified internal rate of return for a given periodic cash flow.

#### Examples

#### See also

`NPV`.

`NOMINAL`

`NOMINAL`

    NOMINAL(r,nper)

#### Description

`NOMINAL` calculates the nominal interest rate from a given effective rate.

Nominal interest rate is given by a formula:

`nper` * (( 1 + `r` ) ^ (1 / `nper`) - 1 )

where:

`r` = effective interest rate

`nper` = number of periods used for compounding

- If `rate` < 0, `NOMINAL` returns #NUM! error.

- If `nper` <= 0, `NOMINAL` returns #NUM! error.

#### Examples

#### See also

`EFFECT`.

`NPER`

`NPER`

    NPER(rate,pmt,pv[,fv,type])

#### Description

`NPER` calculates number of periods of an investment based on periodic constant payments and a constant interest rate.

The interest rate per period is `rate`, `pmt` is the payment made each period, `pv` is the present value, `fv` is the future value and `type` is when the payments are due. If `type` = 1, payments are due at the beginning of the period, if `type` = 0, payments are due at the end of the period.

- If `rate` <= 0, `NPER` returns #DIV0 error.

#### Examples

For example, if you deposit $10,000 in a savings account that earns an interest rate of 6%. To calculate home many years it will take to double your investment use `NPER` as follows:

=`NPER`(0.06, 0, -10000, 20000,0)returns 11.895661046 which indicates that you can double your money just before the end of the 12th year.

#### See also

`PPMT`, `PV`, `FV`.

`NPV`

`NPV`

    NPV(rate,v1,v2,...)

#### Description

`NPV` calculates the net present value of an investment generating periodic payments. `rate` is the periodic interest rate and `v1`, `v2`, ... are the periodic payments. If the schedule of the cash flows are not periodic use the XNPV function.

#### Examples

`NPV`(0.17,-10000,3340,2941,2493,3233,1732,2932) equals 186.30673.

#### See also

`PV`, `XNPV`.

`ODDFPRICE`

`ODDFPRICE`

    ODDFPRICE(settlement,maturity,issue,first_coupon,rate,yld,redemption,frequency[,basis])

#### Description

`ODDFPRICE` returns the price per $100 face value of a security. The security should have an odd short or long first period.

`settlement` is the settlement date of the security. `maturity` is the maturity date of the security. `issue` is the issue date of the security. `frequency` is the number of coupon payments per year. Allowed frequencies are: 1 = annual, 2 = semi, 4 = quarterly. `basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `frequency` is other than 1, 2, or 4, `ODDFPRICE` returns #NUM! error.

- If `basis` is omitted, US 30/360 is applied.

- If `basis` is not in between 0 and 4, #NUM! error is returned.

#### Examples

#### See also

`ODDFYIELD`

`ODDFYIELD`

    ODDFYIELD(settlement,maturity,issue,first_coupon,rate,pr,redemption,frequency[,basis])

#### Description

`ODDFYIELD` calculates the yield of a security having an odd first period.

`settlement` is the settlement date of the security. `maturity` is the maturity date of the security. `frequency` is the number of coupon payments per year. Allowed frequencies are: 1 = annual, 2 = semi, 4 = quarterly. `basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `frequency` is other than 1, 2, or 4, `ODDFYIELD` returns #NUM! error.

- If `basis` is omitted, US 30/360 is applied.

- If `basis` is not in between 0 and 4, #NUM! error is returned.

#### Examples

#### See also

`ODDLPRICE`

`ODDLPRICE`

    ODDLPRICE(settlement,maturity,last_interest,rate,yld,redemption,frequency[,basis])

#### Description

`ODDLPRICE` calculates the price per $100 face value of a security that has an odd last coupon period.

`settlement` is the settlement date of the security. `maturity` is the maturity date of the security. `frequency` is the number of coupon payments per year. Allowed frequencies are: 1 = annual, 2 = semi, 4 = quarterly. `basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `frequency` is other than 1, 2, or 4, `ODDLPRICE` returns #NUM! error.

- If `basis` is omitted, US 30/360 is applied.

- If `basis` is not in between 0 and 4, #NUM! error is returned.

#### Examples

#### See also

`ODDLYIELD`

`ODDLYIELD`

    ODDLYIELD(settlement,maturity,last_interest,rate,pr,redemption,frequency[,basis])

#### Description

`ODDLYIELD` calculates the yield of a security having an odd last period.

`settlement` is the settlement date of the security. `maturity` is the maturity date of the security. `frequency` is the number of coupon payments per year. Allowed frequencies are: 1 = annual, 2 = semi, 4 = quarterly. `basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `frequency` is other than 1, 2, or 4, `ODDLYIELD` returns #NUM! error.

- If `basis` is omitted, US 30/360 is applied.

- If `basis` is not in between 0 and 4, #NUM! error is returned.

#### Examples

#### See also

`OPT_2_ASSET_CORRELATION`

`OPT_2_ASSET_CORRELATION`

    OPT_2_ASSSET_CORRELATION(call_put_flag,spot1,spot2,strike1,strike2,time,cost_of_carry1,cost_of_carry2,rate,volatility1,volatility2,rho)

#### Description

`OPT_2_ASSET_CORRELATION` models the theoretical price of options on 2 assets with correlation `rho`.

The payoff for a call is max(`spot2` - `strike2`,0) if `spot1` > `strike1` or 0 otherwise.

The payoff for a put is max (`strike2` - `spot2`, 0) if `spot1` < `strike1` or 0 otherwise.

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`spot1` & `spot2` are the spot prices of the underlying assets.

`strike1` & `strike2` are the strike prices at which the option is struck.

`time` is the initial maturity of the option in years.

`rate` is the risk annualized free rate of interest.

`cost_of_carry1` & `cost_of_carry2` are the leakage in value of the underlying assets, for common stocks, this would be the dividend yield.

`volatility1` & `volatility2` are the annualized volatility in price of the underlying assets.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_AMER_EXCHANGE`

`OPT_AMER_EXCHANGE`

    OPT_AMER_EXCHANGE(spot1,spot2,qty1,qty2,time,rate,cost_of_carry1,cost_of_carry2,volatility1, volatility2, rho)

#### Description

`OPT_AMER_EXCHANGE` models the theoretical price of an American option to exchange one asset with quantity `qty2` and spot price `spot2` for another, with quantity `qty1` and spot price `spot1`.

`time` is the initial maturity of the option in years.

`rate` is the risk annualized free rate of interest.

`cost_of_carry1` & `cost_of_carry2` are the leakage in value of the underlying assets, for common stocks, this would be the dividend yield.

`volatility1` & `volatility2` are the annualized volatility in price of the underlying assets.

`rho` is the correlation between the two assets.

#### Examples

#### See also

`OPT_EURO_EXCHANGE`, `OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_BAW_AMER`

`OPT_BAW_AMER`

    OPT_BAW_AMER(call_put_flag,spot,strike,time,rate,cost_of_carry,volatility)

#### Description

`OPT_BAW_AMER` models the theoretical price of an option according to the Barone Adesie & Whaley approximation.

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`spot` is the spot price of the underlying asset.

`strike` is the strike price at which the option is struck.

`time` is the number of days to maturity of the option.

`rate` is the risk annualized free rate of interest.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

`volatility` is the annualized volatility in price of the underlying asset.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_BINOMIAL`

`OPT_BINOMIAL`

    OPT_BINOMIAL(amer_euro_flag,call_put_flag,num_time_steps, spot, strike, time, rate, volatility, cost_of_carry)

#### Description

OPT_ models the theoretical price of either an American or European style option using a binomial tree.

`amer_euro_flag` is either 'a' or 'e' to indicate whether the option being valued is an American or European style option respectively.

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`num_time_steps` is the number of time steps used in the valuation, a greater number of time steps yields greater accuracy however is slower to calculate.

`spot` is the spot price of the underlying asset.

`strike` is the strike price at which the option is struck.

`time` is the initial maturity of the option in years.

`rate` is the risk annualized free rate of interest.

`volatility` is the annualized volatility in price of the underlying asset.

`cost_of_carry` is the leakage in value of the underlying asset.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_BJERSTENS`

`OPT_BJERSTENS`

    OPT_BJERSTENS(call_put_flag,spot,strike,time,rate,volatility[,cost_of_carry])

#### Description

`OPT_BJERSTENS` models the theoretical price of american options according to the Bjerksund & Stensland approximation technique.

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`spot` is the spot price of the underlying asset.

`strike` is the strike price at which the option is struck.

`time` is the number of days to maturity of the option.

`rate` is the risk annualized free rate of interest.

`volatility` is the annualized volatility in price of the underlying asset.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_BS`

`OPT_BS`

    OPT_BS(call_put_flag,spot,strike,time,rate,volatility [,cost_of_carry])

#### Description

`OPT_BS` uses the Black-Scholes model to calculate the price of a European option using call_put_flag, `call_put_flag`, 'c' or 'p' struck at `strike` on an asset with spot price `spot`.

`time` is the time to maturity of the option expressed in years.

`rate` is the risk-free interest rate.

`volatility` is the annualized volatility, in percent, of the asset for the period through to the exercise date.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

- The returned value will be expressed in the same units as `strike` and `spot`.

#### Examples

#### See also

`OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_VEGA`, `OPT_BS_GAMMA`.

`OPT_BS_CARRYCOST`

`OPT_BS_CARRYCOST`

    OPT_BS_CARRYCOST(call_put_flag,spot,strike,time,rate,volatility[,cost_of_carry])

#### Description

`OPT_BS_CARRYCOST` uses the Black-Scholes model to calculate the 'elasticity' of a European option struck at `strike` on an asset with spot price `spot`.

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

(The elasticity of an option is the rate of change of its price with respect to its cost of carry.)

`volatility` is the annualized volatility, in percent, of the asset for the period through to the exercise date. `time` is the time to maturity of the option expressed in years.

`rate` is the risk-free interest rate to the exercise date, in percent.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

- The returned value will be expressed as the rate of change of option value, per 100% volatility.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_BS_DELTA`

`OPT_BS_DELTA`

    OPT_BS_DELTA(call_put_flag,spot,strike,time,rate,volatility[,cost_of_carry])

#### Description

`OPT_BS_DELTA` uses the Black-Scholes model to calculate the 'delta' of a European option with call_put_flag, `call_put_flag`, 'c' or 'p' struck at `strike` on an asset with spot price `spot`.

Where `time` is the time to maturity of the option expressed in years.

`rate` is the risk-free interest rate.

`volatility` is the annualized volatility, in percent, of the asset for the period through to the exercise date.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

- The returned value will be expressed in the same units as `strike` and `spot`.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_VEGA`, `OPT_BS_GAMMA`.

`OPT_BS_GAMMA`

`OPT_BS_GAMMA`

    OPT_BS_GAMMA(spot,strike,time,rate,volatility[,cost_of_carry])

#### Description

`OPT_BS_GAMMA` uses the Black-Scholes model to calculate the 'gamma' of a European option struck at `strike` on an asset with spot price `spot`.

(The gamma of an option is the second derivative of its price with respect to the price of the underlying asset, and is the same for calls and puts.)

`time` is the time to maturity of the option expressed in years.

`rate` is the risk-free interest rate to the exercise date, in percent.

`volatility` is the annualized volatility, in percent, of the asset for the period through to the exercise date.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

- The returned value will be expressed as the rate of change of delta per unit change in `spot`.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_VEGA`.

`OPT_BS_RHO`

`OPT_BS_RHO`

    OPT_BS_RHO(call_put_flag,spot,strike,time,rate,volatility[,cost_of_carry])

#### Description

`OPT_BS_RHO` uses the Black-Scholes model to calculate the 'rho' of a European option with call_put_flag, `call_put_flag` struck at `strike` on an asset with spot price `spot`.

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

(The rho of an option is the rate of change of its price with respect to the risk free interest rate.)

`time` is the time to maturity of the option expressed in years.

`rate` is the risk-free interest rate to the exercise date, in percent.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

- The returned value will be expressed as the rate of change of option value, per 100% change in `rate`.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_THETA`, `OPT_BS_VEGA`, `OPT_BS_GAMMA`.

`OPT_BS_THETA`

`OPT_BS_THETA`

    OPT_BS_THETA(call_put_flag,spot,strike,time,rate,volatility[,cost_of_carry])

#### Description

`OPT_BS_THETA` uses the Black-Scholes model to calculate the 'theta' of a European option with call_put_flag, `call_put_flag` struck at `strike` on an asset with spot price `spot`.

(The theta of an option is the rate of change of its price with respect to time to expiry.)

`time` is the time to maturity of the option expressed in years

and `rate` is the risk-free interest rate to the exercise date, in percent.

`volatility` is the annualized volatility, in percent, of the asset for the period through to the exercise date.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

- The returned value will be expressed as minus the rate of change of option value, per 365.25 days.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_VEGA`, `OPT_BS_GAMMA`.

`OPT_BS_VEGA`

`OPT_BS_VEGA`

    OPT_BS_VEGA(spot,strike,time,rate,volatility[,cost_of_carry])

#### Description

`OPT_BS_VEGA` uses the Black-Scholes model to calculate the 'vega' of a European option struck at `strike` on an asset with spot price `spot`.

(The vega of an option is the rate of change of its price with respect to volatility, and is the same for calls and puts.)

`volatility` is the annualized volatility, in percent, of the asset for the period through to the exercise date.

`time` is the time to maturity of the option expressed in years.

`rate` is the risk-free interest rate to the exercise date, in percent.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

- The returned value will be expressed as the rate of change of option value, per 100% volatility.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_COMPLEX_CHOOSER`

`OPT_COMPLEX_CHOOSER`

    OPT_COMPLEX_CHOOSER(call_put_flag,spot,strike_call,strike_put,time,time_call,time_put,rate,cost_of_carry,volatility)

#### Description

`OPT_COMPLEX_CHOOSER` models the theoretical price of complex chooser options.

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`spot` is the spot price of the underlying asset.

`strike_call` is the strike price at which the option is struck, applicable if exercised as a call option.

`strike_put` is the strike price at which the option is struck, applicable if exercised as a put option.

`time` is the time in years until the holder chooses a put or a call option.

`time_call` is the time in years to maturity of the call option if chosen.

`time_put` is the time in years to maturity of the put option if chosen.

`rate` is the risk annualized free rate of interest.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

`volatility` is the annualized volatility in price of the underlying asset.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_EURO_EXCHANGE`

`OPT_EURO_EXCHANGE`

    OPT_EURO_EXCHANGE(spot1,spot2,qty1,qty2,time,rate,cost_of_carry1,cost_of_carry2,volatility1,volatility2,rho)

#### Description

`OPT_EURO_EXCHANGE` models the theoretical price of a European option to exchange one asset with quantity `qty2` and spot price `spot2` for another, with quantity `qty1` and spot price `spot1`.

`time` is the initial maturity of the option in years.

`rate` is the risk annualized free rate of interest.

`cost_of_carry1` & `cost_of_carry2` are the leakage in value of the underlying assets, for common stocks, this would be the dividend yield.

`volatility1` & `volatility2` are the annualized volatility in price of the underlying assets.

`rho` is the correlation between the two assets.

#### Examples

#### See also

`OPT_AMER_EXCHANGE`, `OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_EXEC`

`OPT_EXEC`

    OPT_EXEC(call_put_flag,spot,strike,time,rate,volatility,cost_of_carry,lambda)

#### Description

`OPT_EXEC` models the theoretical price of executive stock options `call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

One would expect this to always be a call option.

`spot` is the spot price of the underlying asset.

`strike` is the strike price at which the option is struck.

`time` is the number of days to maturity of the option.

`rate` is the risk annualized free rate of interest.

`volatility` is the annualized volatility in price of the underlying asset.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

`lambda` is the jump rate for executives. The model assumes executives forfeit their options if they leave the company.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_EXTENDIBLE_WRITER`

`OPT_EXTENDIBLE_WRITER`

    OPT_EXTENDIBLE_WRITER(call_put_flag,spot,strike1,strike2,time1,time2,rate,cost_of_carry,volatility)

#### Description

`OPT_EXTENDIBLE_WRITER` models the theoretical price of extendible writer options. These are options that can be exercised at an initial period, `time1`, or their maturity extended to `time2` if the option is out of the money at `time1`.

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`spot` is the spot price of the underlying asset.

`strike1` is the strike price at which the option is struck.

`strike2` is the strike price at which the option is re-struck if out of the money at `time1`.

`time1` is the initial maturity of the option in years.

`time2` is the is the extended maturity in years if chosen.

`rate` is the risk annualized free rate of interest.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

`volatility` is the annualized volatility in price of the underlying asset.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_FIXED_STRK_LKBK`

`OPT_FIXED_STRK_LKBK`

    OPT_FIXED_STRK_LKBK(call_put_flag,spot,spot_min,spot_max,strike,time,rate,cost_of_carry,volatility)

#### Description

`OPT_FIXED_STRK_LKBK` models the theoretical price of an option where the holder of the option may exercise on expiry at the most favourable price observed during the options life of the underlying asset.

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`spot` is the spot price of the underlying asset.

`spot_min` is the minimum spot price of the underlying asset so far observed.

`spot_max` is the maximum spot price of the underlying asset so far observed.

`strike` is the strike prices at which the option is struck.

`time` is the initial maturity of the option in years.

`rate` is the risk annualized free rate of interest.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

`volatility` is the annualized volatility in price of the underlying asset.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_FLOAT_STRK_LKBK`

`OPT_FLOAT_STRK_LKBK`

    OPT_FLOAT_STRK_LKBK(call_put_flag,spot,spot_min,spot_max,time,rate,cost_of_carry,volatility)

#### Description

`OPT_FLOAT_STRK_LKBK` models the theoretical price of an option where the holder of the option may exercise on expiry at the most favourable price observed during the options life of the underlying asset.

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`spot` is the spot price of the underlying asset.

`spot_min` is the minimum spot price of the underlying asset so far observed.

`spot_max` is the maximum spot price of the underlying asset so far observed.

`time` is the initial maturity of the option in years.

`rate` is the risk annualized free rate of interest.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

`volatility` is the annualized volatility in price of the underlying asset.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_FORWARD_START`

`OPT_FORWARD_START`

    OPT_FORWARD_START(call_put_flag,spot,alpha,time1,time,rate,volatility,cost_of_carry)

#### Description

`OPT_FORWARD_START` models the theoretical price of forward start options

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`spot` is the spot price of the underlying asset.

`alpha` is a fraction that set the strike price the future date `time1`.

`time1` is the number of days until the option starts.

`time` is the number of days to maturity of the option.

`rate` is the risk annualized free rate of interest.

`volatility` is the annualized volatility in price of the underlying asset.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_FRENCH`

`OPT_FRENCH`

    OPT_FRENCH(call_put_flag,spot,strike,time,t2,rate,volatility[,cost_of_carry])

#### Description

`OPT_FRENCH` values the theoretical price of a European option adjusted for trading day volatility, struck at `strike` on an asset with spot price `spot`.

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`volatility` is the annualized volatility, in percent, of the asset for the period through to the exercise date.

`time` the number of calendar days to exercise divided by calendar days in the year.

`t2` is the number of trading days to exercise divided by trading days in the year.

`rate` is the risk-free interest rate.

`cost_of_carry` is the leakage in value of the underlying asset, to the exercise date, in percent.

For common stocks, this would be the dividend yield.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_GARMAN_KOHLHAGEN`

`OPT_GARMAN_KOHLHAGEN`

    OPT_GARMAN_KOHLHAGEN(call_put_flag,spot,strike,time,domestic_rate,foreign_rate,volatility[,cost_of_carry])

#### Description

`OPT_GARMAN_KOHLHAGEN` values the theoretical price of a European currency option struck at `strike` on an asset with spot price `spot`.

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`volatility` is the annualized volatility, in percent, of the asset for the period through to the exercise date.

`time` the number of days to exercise.

`domestic_rate` is the domestic risk-free interest rate to the exercise date.

`foreign_rate` is the foreign risk-free interest rate to the exercise date, in percent.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

- The returned value will be expressed as the rate of change of option value, per 100% volatility.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_JUMP_DIFF`

`OPT_JUMP_DIFF`

    OPT_JUMP_DIFF(call_put_flag,spot,strike,time,rate,volatility,lambda,gamma)

#### Description

`OPT_JUMP_DIFF` models the theoretical price of an option according to the Jump Diffusion process (Merton).

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`spot` is the spot price of the underlying asset.

`strike` is the strike price of the option.

`time` is the time to maturity of the option expressed in years.

`rate` is the annualized rate of interest.

`volatility` is the annualized volatility of the underlying asset.

`lambda` is expected number of 'jumps' per year.

`gamma` is proportion of volatility explained by the 'jumps.'

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_MILTERSEN_SCHWARTZ`

`OPT_MILTERSEN_SCHWARTZ`

    OPT_MILTERSEN_SCHWARTZ(call_put_flag,p_t,f_t,x,t1,t2,v_s,v_e,v_f,rho_se,rho_sf,rho_ef,kappa_e,kappa_f)

#### Description

`OPT_MILTERSEN_SCHWARTZ` models the theoretical price of options on commodities futures according to Miltersen & Schwartz.

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`p_t` is a zero coupon bond with expiry at option maturity.

`f_t` is is the futures price.

`x` is is the strike price.

`t1` is the time to maturity of the option.

`t2` is the time to maturity of the underlying commodity futures contract.

`v_s` is the volatility of the spot commodity price.

`v_e` is the volatility of the future convenience yield.

`v_f` is the volatility of the forward rate of interest.

`rho_se` is correlation between the spot commodity price and the convenience yield.

`rho_sf` is correlation between the spot commodity price and the forward interest rate.

`rho_ef` is correlation between the forward interest rate and the convenience yield.

`kappa_e` is the speed of mean reversion of the convenience yield.

`kappa_f` is the speed of mean reversion of the forward interest rate.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_ON_OPTIONS`

`OPT_ON_OPTIONS`

    OPT_ON_OPTIONS(type_flag,spot,strike1,strike2,time1,time2,rate,cost_of_carry,volatility)

#### Description

`OPT_ON_OPTIONS` models the theoretical price of options on options.

`type_flag` is 'cc' for calls on calls, 'cp' for calls on puts, and so on for 'pc', and 'pp'.

`spot` is the spot price of the underlying asset.

`strike1` is the strike price at which the option being valued is struck.

`strike2` is the strike price at which the underlying option is struck.

`time1` is the time in years to maturity of the option.

`time2` is the time in years to the maturity of the underlying option.

(`time2` >= `time1`).

`rate` is the risk annualized free rate of interest.

`cost_of_carry` is the leakage in value of the underlying asset of the underlying option.for common stocks, this would be the dividend yield.

`volatility` is the annualized volatility in price of the underlying asset of the underlying option.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_RGW`

`OPT_RGW`

    OPT_RGW(call_put_flag,spot,strike,t1,t2,rate,d,volatility)

#### Description

`OPT_RGW` models the theoretical price of an american option according to the Roll-Geske-Whaley approximation where:

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`spot` is the spot price of the underlying asset.

`strike` is the strike price at which the option is struck.

`t1` is the time to the dividend payout.

`t2` is the time to option expiration.

`rate` is the annualized rate of interest.

`d` is the amount of the dividend to be paid.

`volatility` is the annualized rate of volatility of the underlying asset.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_SIMPLE_CHOOSER`

`OPT_SIMPLE_CHOOSER`

    OPT_SIMPLE_CHOOSER(call_put_flag,spot,strike,time1,time2,rate,cost_of_carry,volatility)

#### Description

`OPT_SIMPLE_CHOOSER` models the theoretical price of simple chooser options.

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`spot` is the spot price of the underlying asset.

`strike` is the strike price at which the option is struck.

`time1` is the time in years until the holder chooses a put or a call option.

`time2` is the time in years until the the chosen option expires.

`rate` is the risk annualized free rate of interest.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_SPREAD_APPROX`

`OPT_SPREAD_APPROX`

    OPT_SPREAD_APPROX(call_put_flag,fut_price1,fut_price2,strike,time, rate,volatility1,volatility2,rho)

#### Description

`OPT_SPREAD_APPROX` models the theoretical price of a European option on the spread between two futures contracts.

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`fut_price1` & `fut_price2` are the prices of the two futures contracts.

`strike` is the strike price at which the option is struck

`time` is the initial maturity of the option in years.

`rate` is the risk annualized free rate of interest.

`volatility1` & `volatility2` are the annualized volatility in price of the underlying futures contracts.

`rho` is the correlation between the two futures contracts.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`OPT_TIME_SWITCH`

`OPT_TIME_SWITCH`

    OPT_TIME_SWITCH(call_put_flag,spot,strike,a,time,m,dt,rate,cost_of_carry,volatility)

#### Description

`OPT_TIME_SWITCH` models the theoretical price of time switch options. (Pechtl 1995)

The holder receives `a` * `dt` for each period dt that the asset price was greater than the strike price (for a call) or below it (for a put).

`call_put_flag` is 'c' or 'p' to indicate whether the option is a call or a put.

`spot` is the spot price of the underlying asset.

`strike` is the strike price at which the option is struck.

`a` is the amount received for each time period as discussed above.

`time` is the maturity of the option in years.

`m` is the number of time units the option has already met the condition.

`dt` is the agreed upon discrete time period (often a day) expressed as a fraction of a year.

`rate` is the risk annualized free rate of interest.

`cost_of_carry` is the leakage in value of the underlying asset, for common stocks, this would be the dividend yield.

#### Examples

#### See also

`OPT_BS`, `OPT_BS_DELTA`, `OPT_BS_RHO`, `OPT_BS_THETA`, `OPT_BS_GAMMA`.

`PMT`

`PMT`

    PMT(rate,nper,pv[,fv,type])

#### Description

`PMT` returns the amount of payment for a loan based on a constant interest rate and constant payments (each payment is equal amount).

`rate` is the constant interest rate.

`nper` is the overall number of payments.

`pv` is the present value.

`fv` is the future value.

`type` is the type of the payment: 0 means at the end of the period and 1 means at the beginning of the period.

- If `fv` is omitted, Gnumeric assumes it to be zero.

- If `type` is omitted, Gnumeric assumes it to be zero.

#### Examples

#### See also

`PPMT`, `PV`, `FV`.

`PPMT`

`PPMT`

    PPMT(rate,per,nper,pv[,fv,type])

#### Description

`PPMT` calculates the amount of a payment of an annuity going towards principal.

Formula for it is:

`PPMT`(per) = PMT - IPMT(per)

where:

PMT = Payment received on annuity

IPMT(per) = amount of interest for period `per`

- If `fv` is omitted, it is assumed to be 0.

- If `type` is omitted, it is assumed to be 0.

#### Examples

#### See also

`IPMT`, `PV`, `FV`.

`PRICE`

`PRICE`

    PRICE(settle,mat,rate,yield,redemption_price,[frequency,basis])

#### Description

`PRICE` returns price per $100 face value of a security. This method can only be used if the security pays periodic interest.

`frequency` is the number of coupon payments per year. Allowed frequencies are: 1 = annual, 2 = semi, 4 = quarterly. `basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `frequency` is other than 1, 2, or 4, `PRICE` returns #NUM! error.

- If `basis` is omitted, US 30/360 is applied.

- If `basis` is not in between 0 and 4, #NUM! error is returned.

#### Examples

#### See also

`PRICEDISC`

`PRICEDISC`

    PRICEDISC(settlement,maturity,discount,redemption[,basis])

#### Description

`PRICEDISC` calculates and returns the price per $100 face value of a security bond. The security does not pay interest at maturity.

`settlement` is the settlement date of the security. `maturity` is the maturity date of the security. `discount` is the rate for which the security is discounted. `redemption` is the amount to be received on `maturity` date.

`basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `settlement` date or `maturity` date is not valid, `PRICEDISC` returns #NUM! error.

- If `basis` is omitted, US 30/360 is applied.

- If `basis` < 0 or `basis` > 4, `PRICEDISC` returns #NUM! error.

- If `settlement` date is after `maturity` date or they are the same, `PRICEDISC` returns #NUM! error.

#### Examples

#### See also

`PRICEMAT`.

`PRICEMAT`

`PRICEMAT`

    PRICEMAT(settlement,maturity,issue,rate,yield[,basis])

#### Description

`PRICEMAT` calculates and returns the price per $100 face value of a security. The security pays interest at maturity.

`settlement` is the settlement date of the security. `maturity` is the maturity date of the security. `issue` is the issue date of the security. `rate` is the discount rate of the security. `yield` is the annual yield of the security. `basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `settlement` date or `maturity` date is not valid, `PRICEMAT` returns #NUM! error.

- If `basis` is omitted, US 30/360 is applied.

- If `basis` < 0 or `basis` > 4, `PRICEMAT` returns #NUM! error.

- If `settlement` date is after `maturity` date or they are the same, `PRICEMAT` returns #NUM! error.

#### Examples

#### See also

`PRICEDISC`.

`PV`

`PV`

    PV(rate,nper,pmt[,fv,type])

#### Description

`PV` calculates the present value of an investment. `rate` is the periodic interest rate, `nper` is the number of periods used for compounding. `pmt` is the payment made each period, `fv` is the future value and `type` is when the payment is made.

- If `type` = 1 then the payment is made at the beginning of the period.

- If `type` = 0 (or omitted) it is made at the end of each period.

#### Examples

#### See also

`FV`.

`RATE`

`RATE`

    RATE(nper,pmt,pv[,fv,type,guess])

#### Description

`RATE` calculates the rate of an investment.

- If `nper` <= 0, `RATE` returns #NUM! error.

- If `type` != 0 and `type` != 1, `RATE` returns #VALUE! error.

#### Examples

#### See also

`PV`, `FV`.

`RECEIVED`

`RECEIVED`

    RECEIVED(settlement,maturity,investment,rate[,basis])

#### Description

`RECEIVED` calculates and returns the amount to be received at maturity date for a security bond.

`settlement` is the settlement date of the security. `maturity` is the maturity date of the security. The amount of investment is specified in `investment`. `rate` is the security's discount rate.

`basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `settlement` date or `maturity` date is not valid, `RECEIVED` returns #NUM! error.

- If `basis` is omitted, US 30/360 is applied.

- If `basis` < 0 or `basis` > 4, `RECEIVED` returns #NUM! error.

- If `settlement` date is after `maturity` date or they are the same, `RECEIVED` returns #NUM! error.

#### Examples

#### See also

`INTRATE`.

`SLN`

`SLN`

    SLN(cost,salvage_value,life)

#### Description

`SLN` function will determine the straight line depreciation of an asset for a single period.

The formula is:

Depreciation expense = ( `cost` - `salvage_value` ) / `life`

`cost` is the cost of an asset when acquired (market value).

`salvage_value` is the amount you get when asset is sold at the end of the asset's useful life.

`life` is the anticipated life of an asset.

- If `life` <= 0, `SLN` returns #NUM! error.

#### Examples

For example, lets suppose your company purchases a new machine for $10,000, which has a salvage value of $700 and will have a useful life of 10 years. The `SLN` yearly depreciation is computed as follows:

=`SLN`(10000, 700, 10)

This will return the yearly depreciation figure of $930.

#### See also

`SYD`.

`SYD`

`SYD`

    SYD(cost,salvage_value,life,period)

#### Description

`SYD` function calculates the sum-of-years digits depreciation for an asset based on its cost, salvage value, anticipated life and a particular period. This method accelerates the rate of the depreciation, so that more depreciation expense occurs in earlier periods than in later ones. The depreciable cost is the actual cost minus the salvage value. The useful life is the number of periods (typically years) over with the asset is depreciated.

The Formula used for sum-of-years digits depreciation is:

Depreciation expense =

( `cost` - `salvage_value` ) * (`life` - `period` + 1) * 2 / `life` * (`life` + 1).

`cost` is the cost of an asset when acquired (market value).

`salvage_value` is the amount you get when asset sold at the end of its useful life.

`life` is the anticipated life of an asset.

`period` is the period for which we need the expense.

- If `life` <= 0, `SYD` returns #NUM! error.

#### Examples

For example say a company purchases a new computer for $5000 which has a salvage value of $200, and a useful life of five years. We would use the following to calculate the second year's depreciation using the `SYD` method:

=`SYD`(5000, 200, 5, 2) which returns 1,280.00.

#### See also

`SLN`.

`TBILLEQ`

`TBILLEQ`

    TBILLEQ(settlement,maturity,discount)

#### Description

`TBILLEQ` function returns the bond-yield equivalent (BEY) for a treasury bill. `TBILLEQ` is equivalent to

(365 * `discount`) / (360 - `discount` * DSM),

where DSM is the days between `settlement` and `maturity`.

- If `settlement` is after `maturity` or the `maturity` is set to over one year later than the `settlement`, `TBILLEQ` returns #NUM! error.

- If `discount` is negative, `TBILLEQ` returns #NUM! error.

#### Examples

#### See also

`TBILLPRICE`, `TBILLYIELD`.

`TBILLPRICE`

`TBILLPRICE`

    TBILLPRICE(settlement,maturity,discount)

#### Description

`TBILLPRICE` function returns the price per $100 value for a treasury bill where `settlement` is the settlement date and `maturity` is the maturity date of the bill. `discount` is the treasury bill's discount rate.

- If `settlement` is after `maturity` or the `maturity` is set to over one year later than the `settlement`, `TBILLPRICE` returns #NUM! error.

- If `discount` is negative, `TBILLPRICE` returns #NUM! error.

#### Examples

#### See also

`TBILLEQ`, `TBILLYIELD`.

`TBILLYIELD`

`TBILLYIELD`

    TBILLYIELD(settlement,maturity,pr)

#### Description

`TBILLYIELD` function returns the yield for a treasury bill. `settlement` is the settlement date and `maturity` is the maturity date of the bill. `discount` is the treasury bill's discount rate.

- If `settlement` is after `maturity` or the `maturity` is set to over one year later than the `settlement`, `TBILLYIELD` returns #NUM! error.

- If `pr` is negative, `TBILLYIELD` returns #NUM! error.

#### Examples

#### See also

`TBILLEQ`, `TBILLPRICE`.

`VDB`

`VDB`

    VDB(cost,salvage,life,start_period,end_period[,factor,switch])

#### Description

`VDB` calculates the depreciation of an asset for a given period or partial period using the double-declining balance method.

- If `start_period` < 0, `VDB` returns #NUM! error.

- If `start_period` > `end_period`, `VDB` returns #NUM! error.

- If `end_period` > `life`, `VDB` returns #NUM! error.

- If `cost` < 0, `VDB` returns #NUM! error.

- If `salvage` > `cost`, `VDB` returns #NUM! error.

- If `factor` <= 0, `VDB` returns #NUM! error.

#### Examples

#### See also

`DB`.

`XIRR`

`XIRR`

    XIRR(values,dates[,guess])

#### Description

`XIRR` calculates and returns the internal rate of return of an investment that has not necessarily periodic payments. This function is closely related to the net present value function (NPV and XNPV). The `XIRR` is the interest rate for a series of cash flows where the XNPV is zero.

`values` contains the series of cash flows generated by the investment. `dates` contains the dates of the payments. The first date describes the payment day of the initial payment and thus all the other dates should be after this date. The optional `guess` is the initial value used in calculating the `XIRR`. You do not have to use that, it is only provided for the Excel compatibility.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1:A5 contain the numbers -6000, 2134, 1422, 1933, and 1422, and the cells B1:B5 contain the dates "1999-01-15", "1999-04-04", "1999-05-09", "2000-03-12", and "2000-05-1". Then

`XIRR`(A1:A5,B1:B5) returns 0.224838.

#### See also

`IRR`, `XNPV`.

`XNPV`

`XNPV`

    XNPV(rate,values,dates)

#### Description

`XNPV` calculates the net present value of an investment. The schedule of the cash flows is given in `dates` array. The first date indicates the beginning of the payment schedule. `rate` is the interest rate and `values` are the payments.

- If `values` and `dates` contain unequal number of values, `XNPV` returns the #NUM! error.

#### Examples

#### See also

`NPV`, `PV`.

`YIELD`

`YIELD`

    YIELD(settlement,maturity,rate,price,redemption_price,frequency[,basis])

#### Description

`YIELD` returns the yield on a security that pays periodic interest.

`frequency` is the number of coupon payments per year. Allowed frequencies are: 1 = annual, 2 = semi, 4 = quarterly. `basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `frequency` is other than 1, 2, or 4, `YIELD` returns #NUM! error.

- If `basis` is omitted, US 30/360 is applied.

- If `basis` is not in between 0 and 4, #NUM! error is returned.

#### Examples

#### See also

`YIELDDISC`

`YIELDDISC`

    YIELDDISC(settlement,maturity,pr,redemption[,basis])

#### Description

`YIELDDISC` calculates the annual yield of a security that is discounted.

`settlement` is the settlement date of the security. `maturity` is the maturity date of the security. `pr` is the price per $100 face value of the security. `redemption` is the redemption value per $100 face value. `basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `frequency` is other than 1, 2, or 4, `YIELDDISC` returns #NUM! error.

- If `basis` is omitted, US 30/360 is applied.

- If `basis` is not in between 0 and 4, #NUM! error is returned.

#### Examples

#### See also

`YIELDMAT`

`YIELDMAT`

    YIELDMAT(settlement,maturity,issue,rate,pr[,basis])

#### Description

`YIELDMAT` calculates the annual yield of a security for which the interest is payed at maturity date.

`settlement` is the settlement date of the security. `maturity` is the maturity date of the security. `issue` is the issue date of the security. `rate` is the interest rate set to the security. `pr` is the price per $100 face value of the security. `basis` is the type of day counting system you want to use:

0 US 30/360

1 actual days/actual days

2 actual days/360

3 actual days/365

4 European 30/360

- If `basis` is omitted, US 30/360 is applied.

- If `basis` is not in between 0 and 4, #NUM! error is returned.

#### Examples

#### See also

## Gnumeric

`GNUMERIC_VERSION`

`GNUMERIC_VERSION`

    GNUMERIC_VERSION()

#### Description

`GNUMERIC_VERSION` returns the version of gnumeric as a string.

#### Examples

`GNUMERIC_VERSION`().

#### See also

## Information

`CELL`

`CELL`

    CELL(type,ref)

#### Description

`CELL` returns information about the formatting, location, or contents of a cell.

`type` specifies the type of information you want to obtain:

address Returns the given cell reference as text.

col Returns the number of the column in `ref`.

contents Returns the contents of the cell in `ref`.

format Returns the code of the format of the cell.

parentheses Returns 1 if `ref` contains a negative value

and its format displays it with parentheses.

row Returns the number of the row in `ref`.

width Returns the column width.

- This function is Excel compatible.

#### Examples

Cell("format",A1) returns the code of the format of the cell A1.

#### See also

`INDIRECT`.

`COUNTBLANK`

`COUNTBLANK`

    COUNTBLANK(range)

#### Description

`COUNTBLANK` returns the number of blank cells in a `range`.

- This function is Excel compatible.

#### Examples

`COUNTBLANK`(A1:A20) returns the number of blank cell in A1:A20.

#### See also

`COUNT`.

`ERROR`

`ERROR`

    ERROR(text)

#### Description

`ERROR` return the specified error.

#### Examples

`ERROR`("#OWN `ERROR`").

#### See also

`ISERROR`.

`ERROR.TYPE`

`ERROR.TYPE`

    ERROR.TYPE(value)

#### Description

`ERROR.TYPE` returns an error number corresponding to the given error value. The error numbers for error values are:

#DIV/0! 2

#VALUE! 3

#REF! 4

#NAME? 5

#NUM! 6

#N/A 7

- This function is Excel compatible.

#### Examples

`ERROR.TYPE`(NA()) equals 7.

#### See also

`ISERROR`.

`EXPRESSION`

`EXPRESSION`

    EXPRESSION(cell)

#### Description

`EXPRESSION` returns expression in `cell` as a string, or empty if the cell is not an expression.

#### Examples

entering '=`EXPRESSION`(A3)' in A2 = empty (assuming there is nothing in A3).

entering '=`EXPRESSION`(A2)' in A1 = '`EXPRESSION`(A3)'.

#### See also

`TEXT`.

`GETENV`

`GETENV`

    GETENV(string)

#### Description

`GETENV` retrieves a value from the execution environment.

- If the variable specified by `string` does not exist, #N/A! will be returned. Note, that variable names are case sensitive.

#### Examples

#### See also

`INFO`

`INFO`

    INFO(type)

#### Description

`INFO` returns information about the current operating environment.

`type` is the type of information you want to obtain:

memavail Returns the amount of memory available, bytes.

memused Returns the amount of memory used (bytes).

numfile Returns the number of active worksheets.

osversion Returns the operating system version.

recalc Returns the recalculation mode (automatic).

release Returns the version of Gnumeric as text.

system Returns the name of the environment.

totmem Returns the amount of total memory available.

- This function is Excel compatible, except that types directory and origin are not implemented.

#### Examples

`INFO`("system") returns "Linux" on a Linux system.

#### See also

`ISBLANK`

`ISBLANK`

    ISBLANK(value)

#### Description

`ISBLANK` returns TRUE if the value is blank.

- This function is Excel compatible.

#### Examples

`ISBLANK`(A1).

#### See also

`ISERR`

`ISERR`

    ISERR(value)

#### Description

`ISERR` returns TRUE if the value is any error value except #N/A.

- This function is Excel compatible.

#### Examples

`ISERR`(NA()) return FALSE.

#### See also

`ISERROR`.

`ISERROR`

`ISERROR`

    ISERROR(value)

#### Description

`ISERROR` returns a TRUE value if the expression has an error.

- This function is Excel compatible.

#### Examples

`ISERROR`(NA()) equals TRUE.

#### See also

`ERROR`.

`ISEVEN`

`ISEVEN`

    ISEVEN(value)

#### Description

`ISEVEN` returns TRUE if the number is even.

- This function is Excel compatible.

#### Examples

`ISEVEN`(4) equals TRUE.

#### See also

`ISODD`.

`ISLOGICAL`

`ISLOGICAL`

    ISLOGICAL(value)

#### Description

`ISLOGICAL` returns TRUE if the value is a logical value.

- This function is Excel compatible.

#### Examples

`ISLOGICAL`(A1).

#### See also

`ISNA`

`ISNA`

    ISNA(value)

#### Description

`ISNA` returns TRUE if the value is the #N/A error value.

- This function is Excel compatible.

#### Examples

`ISNA`(NA()) equals TRUE.

#### See also

`NA`.

`ISNONTEXT`

`ISNONTEXT`

    ISNONTEXT(value)

#### Description

`ISNONTEXT` Returns TRUE if the value is not text.

- This function is Excel compatible.

#### Examples

`ISNONTEXT`("text") equals FALSE.

#### See also

`ISTEXT`.

`ISNUMBER`

`ISNUMBER`

    ISNUMBER(value)

#### Description

`ISNUMBER` returns TRUE if the value is a number.

- This function is Excel compatible.

#### Examples

`ISNUMBER`("text") equals FALSE.

#### See also

`ISODD`

`ISODD`

    ISODD(value)

#### Description

`ISODD` returns TRUE if the number is odd.

- This function is Excel compatible.

#### Examples

`ISODD`(3) equals TRUE.

#### See also

`ISEVEN`.

`ISREF`

`ISREF`

    ISREF(value)

#### Description

`ISREF` returns TRUE if the value is a reference.

- This function is Excel compatible.

#### Examples

`ISREF`(A1) equals TRUE.

#### See also

`ISTEXT`

`ISTEXT`

    ISTEXT(value)

#### Description

`ISTEXT` returns TRUE if the value is text.

- This function is Excel compatible.

#### Examples

`ISTEXT`("text") equals TRUE.

#### See also

`ISNONTEXT`.

`N`

`N`

    N(value)

#### Description

`N` returns a value converted to a number. Strings containing text are converted to the zero value.

- This function is Excel compatible.

#### Examples

`N`("42") equals 42.

#### See also

`NA`

`NA`

    NA()

#### Description

`NA` returns the error value #N/A.

- This function is Excel compatible.

#### Examples

`NA`() equals #N/A error.

#### See also

`ISNA`.

`TYPE`

`TYPE`

    TYPE(value)

#### Description

`TYPE` returns a number indicating the data type of a value.

1 == number

2 == text

4 == boolean

16 == error

64 == array

- This function is Excel compatible.

#### Examples

`TYPE`(3) equals 1.

`TYPE`("text") equals 2.

#### See also

## Logic

`AND`

`AND`

    AND(b1, b2, ...)

#### Description

`AND` implements the logical `AND` function: the result is TRUE if all of the expressions evaluate to TRUE, otherwise it returns FALSE.

`b1` trough `bN` are expressions that should evaluate to TRUE or FALSE. If an integer or floating point value is provided, zero is considered FALSE and anything else is TRUE.

- If the values contain strings or empty cells those values are ignored.

- If no logical values are provided, then the error #VALUE! is returned.

- This function is Excel compatible.

#### Examples

`AND`(TRUE,TRUE) equals TRUE.

`AND`(TRUE,FALSE) equals FALSE.

Let us assume that A1 holds number five and A2 number one. Then

`AND`(A1>3,A2<2) equals TRUE.

#### See also

`OR`, `NOT`.

`FALSE`

`FALSE`

    FALSE()

#### Description

`FALSE` returns boolean value false.

- This function is Excel compatible.

#### Examples

`FALSE`() equals `FALSE`.

#### See also

`TRUE`.

`IF`

`IF`

    IF(condition[,if-true,if-false])

#### Description

`IF` function can be used to evaluate conditionally other expressions. `IF` evaluates `condition`. If `condition` returns a non-zero value the result of the `IF` expression is the `if`-true expression, otherwise `IF` evaluates to the value of `if`-false.

- If omitted `if`-true defaults to TRUE and `if`-false to FALSE.

- This function is Excel compatible.

#### Examples

`IF`(FALSE,TRUE,FALSE) equals FALSE.

#### See also

`NOT`

`NOT`

    NOT(number)

#### Description

`NOT` implements the logical `NOT` function: the result is TRUE if the `number` is zero; otherwise the result is FALSE.

- This function is Excel compatible.

#### Examples

`NOT`(0) equals TRUE.

`NOT`(TRUE) equals FALSE.

#### See also

`AND`, `OR`.

`OR`

`OR`

    OR(b1, b2, ...)

#### Description

`OR` implements the logical `OR` function: the result is TRUE if any of the values evaluated to TRUE.

`b1` trough `bN` are expressions that should evaluate to TRUE or FALSE. If an integer or floating point value is provided, zero is considered FALSE and anything else is TRUE.

- If the values contain strings or empty cells those values are ignored.

- If no logical values are provided, then the error #VALUE! is returned.

- This function is Excel compatible.

#### Examples

`OR`(TRUE,FALSE) equals TRUE.

`OR`(3>4,4<3) equals FALSE.

#### See also

`AND`, `NOT`.

`TRUE`

`TRUE`

    TRUE()

#### Description

`TRUE` returns boolean value true.

- This function is Excel compatible.

#### Examples

`TRUE`() equals `TRUE`.

#### See also

`FALSE`.

`XOR`

`XOR`

    XOR(b1, b2, ...)

#### Description

`XOR` implements the logical exclusive OR function: the result is TRUE if an odd number of the values evaluated to TRUE.

`b1` trough `bN` are expressions that should evaluate to TRUE or FALSE. If an integer or floating point value is provided, zero is considered FALSE and anything else is TRUE.

- If the values contain strings or empty cells those values are ignored.

- If no logical values are provided, then the error #VALUE! is returned.

#### Examples

`XOR`(TRUE,FALSE) equals TRUE.

`XOR`(3>4,4<3) equals FALSE.

#### See also

`OR`, `AND`, `NOT`.

## Lookup

`ADDRESS`

`ADDRESS`

    ADDRESS(row_num,col_num[,abs_num,a1,text])

#### Description

`ADDRESS` returns a cell address as text for specified row and column numbers.

`a1` is a logical value that specifies the reference style. If `a1` is TRUE or omitted, `ADDRESS` returns an A1-style reference, i.e. $D$4. Otherwise `ADDRESS` returns an R1C1-style reference, i.e. R4C4.

`text` specifies the name of the worksheet to be used as the external reference.

- If `abs_num` is 1 or omitted, `ADDRESS` returns absolute reference.

- If `abs_num` is 2 `ADDRESS` returns absolute row and relative column.

- If `abs_num` is 3 `ADDRESS` returns relative row and absolute column.

- If `abs_num` is 4 `ADDRESS` returns relative reference.

- If `abs_num` is greater than 4 `ADDRESS` returns #VALUE! error.

- If `row_num` or `col_num` is less than one, `ADDRESS` returns #VALUE! error.

#### Examples

`ADDRESS`(5,4) equals "$D$5".

`ADDRESS`(5,4,4) equals "D5".

`ADDRESS`(5,4,3,FALSE) equals "R[5]C4".

#### See also

`COLUMNNUMBER`.

`AREAS`

`AREAS`

    AREAS(reference)

#### Description

`AREAS` returns the number of areas in `reference`.

#### Examples

`AREAS`((A1,B2,C3)) equals 3.

#### See also

`ADDRESS`, `INDEX`, `INDIRECT`, `OFFSET`.

`CHOOSE`

`CHOOSE`

    CHOOSE(index[,value1][,value2]...)

#### Description

`CHOOSE` returns the value of index `index`. `index` is rounded to an integer if it is not.

- If `index` < 1 or `index` > number of values, `CHOOSE` returns #VALUE! error.

#### Examples

`CHOOSE`(3,"Apple","Orange","Grape","Perry") equals "Grape".

#### See also

`IF`.

`COLUMN`

`COLUMN`

    COLUMN([reference])

#### Description

`COLUMN` function returns the column number of the current cell unless `reference` is given. In that case, it returns an array of the column numbers of all cells in `reference`.

- If `reference` is neither an array nor a reference nor a range, `COLUMN` returns #VALUE! error.

#### Examples

`COLUMN`() in E1 equals 5.

#### See also

`COLUMNS`, `ROW`, `ROWS`.

`COLUMNNUMBER`

`COLUMNNUMBER`

    COLUMNNUMBER(name)

#### Description

`COLUMNNUMBER` function returns an integer corresponding to the column name supplied as a string.

- If `name` is invalid, `COLUMNNUMBER` returns the #VALUE! error.

#### Examples

`COLUMNNUMBER`("E") equals 5.

#### See also

`ADDRESS`.

`COLUMNS`

`COLUMNS`

    COLUMNS(reference)

#### Description

`COLUMNS` function returns the number of columns in area or array reference.

- If `reference` is neither an array nor a reference nor a range, `COLUMNS` returns #VALUE! error.

#### Examples

`COLUMNS`(H2:J3) equals 3.

#### See also

`COLUMN`, `ROW`, `ROWS`.

`HLOOKUP`

`HLOOKUP`

    HLOOKUP(value,range,row[,approximate,as_index])

#### Description

`HLOOKUP` function finds the col in range that has a first row cell similar to `value`. If `approximate` is not true it finds the col with an exact equivalence. If `approximate` is true, then the values must be sorted in order of ascending value for correct function; in this case it finds the col with value less than `value` it returns the value in the col found at a 1-based offset in `row` rows into the `range`. `as_index` returns the 0-based offset that matched rather than the value.

- `HLOOKUP` returns #NUM! if `row` < 0.

- `HLOOKUP` returns #REF! if `row` falls outside `range`.

#### Examples

#### See also

`VLOOKUP`.

`HYPERLINK`

`HYPERLINK`

    HYPERLINK(link_location[,optional_label])

#### Description

`HYPERLINK` function currently returns its 2nd argument, or if that is omitted the 1st argument.

#### Examples

`HYPERLINK`("www.gnome.org","GNOME").

#### See also

`INDEX`

`INDEX`

    INDEX(array[,row, col, area])

#### Description

`INDEX` gives a reference to a cell in the given `array`.The cell is pointed out by `row` and `col`, which count the rows and columns in the array.

- If `row` and `col` are omitted the are assumed to be 1.

- If the reference falls outside the range of the `array`, `INDEX` returns a #REF! error.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then `INDEX`(A1:A5,4,1,1) equals 25.9

#### See also

`INDIRECT`

`INDIRECT`

    INDIRECT(ref_text[,format])

#### Description

`INDIRECT` function returns the contents of the cell pointed to by the `ref_text` string. The string specifies a single cell reference the format of which is either A1 or R1C1 style. The style is set by the `format` boolean, which defaults to the A1 style.

- If `ref_text` is not a valid reference returns #REF!

#### Examples

If A1 contains 3.14 and A2 contains A1, then

`INDIRECT`(A2) equals 3.14.

#### See also

`AREAS`, `INDEX`, `CELL`.

`LOOKUP`

`LOOKUP`

    LOOKUP(value,vector1[,vector2])

#### Description

`LOOKUP` function finds the row index of `value` in `vector1` and returns the contents of `vector2` at that row index. Alternatively a single array can be used for `vector1`. If the area is longer than it is wide then the sense of the search is rotated.

- If `LOOKUP` can't find `value` it uses the largest value less than `value`.

- The data must be sorted.

- If `value` is smaller than the first value it returns #N/A.

#### Examples

#### See also

`VLOOKUP`, `HLOOKUP`.

`MATCH`

`MATCH`

    MATCH(seek,vector[,type])

#### Description

`MATCH` function finds the row index of `seek` in `vector` and returns it.

If the area is longer than it is wide then the sense of the search is rotated. Alternatively a single array can be used.

- The `type` parameter, which defaults to +1, controls the search:

- If `type` = 1, `MATCH` finds largest value <= `seek`.

- If `type` = 0, `MATCH` finds first value == `seek`.

- If `type` = -1, `MATCH` finds smallest value >= `seek`.

- For `type` = 0, the data can be in any order. * For `type` = -1 and `type` = +1, the data must be sorted. (And in these cases, `MATCH` uses a binary search to locate the index.)

- If `seek` could not be found, #N/A is returned.

#### Examples

#### See also

`LOOKUP`.

`OFFSET`

`OFFSET`

    OFFSET(range,row,col[,height[,width]])

#### Description

`OFFSET` function returns a cell range. The cell range starts at offset (`row`,`col`) from `range`, and is of height `height` and width `width`.

- If `range` is neither a reference nor a range, `OFFSET` returns #VALUE!.

- If either `height` or `width` is omitted, the height or width of the reference is used.

#### Examples

#### See also

`COLUMN`, `COLUMNS`, `ROWS`, `INDEX`, `INDIRECT`, `ADDRESS`.

`ROW`

`ROW`

    ROW([reference])

#### Description

`ROW` function returns an array of the row numbers taking a default argument of the containing cell position.

- If `reference` is neither an array nor a reference nor a range, `ROW` returns #VALUE! error.

#### Examples

`ROW`() in G13 equals 13.

#### See also

`COLUMN`, `COLUMNS`, `ROWS`.

`ROWS`

`ROWS`

    ROWS(reference)

#### Description

`ROWS` function returns the number of rows in area or array reference.

- If `reference` is neither an array nor a reference nor a range, `ROWS` returns #VALUE! error.

#### Examples

`ROWS`(H7:I13) equals 7.

#### See also

`COLUMN`, `COLUMNS`, `ROW`.

`TRANSPOSE`

`TRANSPOSE`

    TRANSPOSE(matrix)

#### Description

`TRANSPOSE` function returns the transpose of the input `matrix`.

#### Examples

#### See also

`MMULT`.

`VLOOKUP`

`VLOOKUP`

    VLOOKUP(value,range,column[,approximate,as_index])

#### Description

`VLOOKUP` function finds the row in range that has a first column similar to `value`. If `approximate` is not true it finds the row with an exact equivalence. If `approximate` is true, then the values must be sorted in order of ascending value for correct function; in this case it finds the row with value less than `value`. It returns the value in the row found at a 1-based offset in `column` columns into the `range`. `as_index` returns the 0-based offset that matched rather than the value.

- `VLOOKUP` returns #NUM! if `column` < 0.

- `VLOOKUP` returns #REF! if `column` falls outside `range`.

#### Examples

#### See also

`HLOOKUP`.

## Mathematics

`ABS`

`ABS`

    ABS(b1)

#### Description

`ABS` implements the Absolute Value function: the result is to drop the negative sign (if present). This can be done for integers and floating point numbers.

- This function is Excel compatible.

#### Examples

`ABS`(7) equals 7.

`ABS`(-3.14) equals 3.14.

#### See also

`CEIL`, `CEILING`, `FLOOR`, `INT`, `MOD`.

`ACOS`

`ACOS`

    ACOS(x)

#### Description

`ACOS` function calculates the arc cosine of `x`; that is the value whose cosine is `x`.

- The value it returns is in radians.

- If `x` falls outside the range -1 to 1, `ACOS` returns the #NUM! error.

- This function is Excel compatible.

#### Examples

`ACOS`(0.1) equals 1.470629.

`ACOS`(-0.1) equals 1.670964.

#### See also

`COS`, `SIN`, `DEGREES`, `RADIANS`.

`ACOSH`

`ACOSH`

    ACOSH(x)

#### Description

`ACOSH` function calculates the inverse hyperbolic cosine of `x`; that is the value whose hyperbolic cosine is `x`.

- If `x` is less than 1.0, `ACOSH`() returns the #NUM! error.

- This function is Excel compatible.

#### Examples

`ACOSH`(2) equals 1.31696.

`ACOSH`(5.3) equals 2.35183.

#### See also

`ACOS`, `ASINH`, `DEGREES`, `RADIANS`.

`ASIN`

`ASIN`

    ASIN(x)

#### Description

`ASIN` function calculates the arc sine of `x`; that is the value whose sine is `x`.

- If `x` falls outside the range -1 to 1, `ASIN` returns the #NUM! error.

- This function is Excel compatible.

#### Examples

`ASIN`(0.5) equals 0.523599.

`ASIN`(1) equals 1.570797.

#### See also

`SIN`, `COS`, `ASINH`, `DEGREES`, `RADIANS`.

`ASINH`

`ASINH`

    ASINH(x)

#### Description

`ASINH` function calculates the inverse hyperbolic sine of `x`; that is the value whose hyperbolic sine is `x`.

- This function is Excel compatible.

#### Examples

`ASINH`(0.5) equals 0.481212.

`ASINH`(1.0) equals 0.881374.

#### See also

`ASIN`, `ACOSH`, `SIN`, `COS`, `DEGREES`, `RADIANS`.

`ATAN`

`ATAN`

    ATAN(x)

#### Description

`ATAN` function calculates the arc tangent of `x`; that is the value whose tangent is `x`.

- Return value is in radians.

- This function is Excel compatible.

#### Examples

`ATAN`(0.5) equals 0,463648.

`ATAN`(1) equals 0,785398.

#### See also

`TAN`, `COS`, `SIN`, `DEGREES`, `RADIANS`.

`ATAN2`

`ATAN2`

    ATAN2(b1,b2)

#### Description

`ATAN2` function calculates the arc tangent of the two variables `b1` and `b2`. It is similar to calculating the arc tangent of `b2` / `b1`, except that the signs of both arguments are used to determine the quadrant of the result.

- The result is in radians.

- This function is Excel compatible.

#### Examples

`ATAN2`(0.5,1.0) equals 1.107149.

`ATAN2`(-0.5,2.0) equals 1.815775.

#### See also

`ATAN`, `ATANH`, `COS`, `SIN`, `DEGREES`, `RADIANS`.

`ATANH`

`ATANH`

    ATANH(x)

#### Description

`ATANH` function calculates the inverse hyperbolic tangent of `x`; that is the value whose hyperbolic tangent is `x`.

- If the absolute value of `x` is greater than 1.0, `ATANH` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`ATANH`(0.5) equals 0.549306.

`ATANH`(0.8) equals 1.098612.

#### See also

`ATAN`, `TAN`, `SIN`, `COS`, `DEGREES`, `RADIANS`.

`BETA`

`BETA`

    BETA(a,b)

#### Description

`BETA` function returns the value of the mathematic beta function extended to all real numbers except 0 and negative integers.

- If `a`, `b`, or (`a` + `b`) are non-positive integers, `BETA` returns #NUM! error.

#### Examples

`BETA`(2,3) equals 0.083333.

`BETA`(-0.5,0.5) equals #NUM!.

#### See also

`BETALN`, `GAMMALN`.

`BETALN`

`BETALN`

    BETALN(a,b)

#### Description

`BETALN` function returns the natural logarithm of the absolute value of the beta function.

- If `a`, `b`, or (`a` + `b`) are non-positive integers, `BETALN` returns #NUM!

#### Examples

`BETALN`(2,3) equals -2.48.

`BETALN`(-0.5,0.5) equals #NUM!.

#### See also

`BETA`, `GAMMALN`.

`CEIL`

`CEIL`

    CEIL(x)

#### Description

`CEIL` function rounds `x` up to the next nearest integer.

#### Examples

`CEIL`(0.4) equals 1.

`CEIL`(-1.1) equals -1.

`CEIL`(-2.9) equals -2.

#### See also

`CEILING`, `FLOOR`, `ABS`, `INT`, `MOD`.

`CEILING`

`CEILING`

    CEILING(x,significance)

#### Description

`CEILING` function rounds `x` up to the nearest multiple of `significance`.

- If `x` or `significance` is non-numeric `CEILING` returns #VALUE! error.

- If `x` and `significance` have different signs `CEILING` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`CEILING`(2.43,1) equals 3.

`CEILING`(123.123,3) equals 126.

#### See also

`CEIL`, `FLOOR`, `ABS`, `INT`, `MOD`.

`COMBIN`

`COMBIN`

    COMBIN(n,k)

#### Description

`COMBIN` computes the number of combinations.

- Performing this function on a non-integer or a negative number returns #NUM! error.

- If `n` is less than `k` `COMBIN` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`COMBIN`(8,6) equals 28.

`COMBIN`(6,2) equals 15.

#### See also

`COS`

`COS`

    COS(x)

#### Description

`COS` function returns the cosine of `x`, where `x` is given in radians.

- This function is Excel compatible.

#### Examples

`COS`(0.5) equals 0.877583.

`COS`(1) equals 0.540302.

#### See also

`COSH`, `SIN`, `SINH`, `TAN`, `TANH`, `RADIANS`, `DEGREES`.

`COSH`

`COSH`

    COSH(x)

#### Description

`COSH` function returns the hyperbolic cosine of `x`, which is defined mathematically as

(exp(`x`) + exp(-`x`)) / 2.

- `x` is in radians.

- This function is Excel compatible.

#### Examples

`COSH`(0.5) equals 1.127626.

`COSH`(1) equals 1.543081.

#### See also

`COS`, `SIN`, `SINH`, `TAN`, `TANH`, `RADIANS`, `DEGREES`, `EXP`.

`COUNTIF`

`COUNTIF`

    COUNTIF(range,criteria)

#### Description

`COUNTIF` function counts the number of cells in the given `range` that meet the given `criteria`.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 23, 27, 28, 33, and 39. Then

`COUNTIF`(A1:A5,"<=28") equals 3.

`COUNTIF`(A1:A5,"<28") equals 2.

`COUNTIF`(A1:A5,"28") equals 1.

`COUNTIF`(A1:A5,">28") equals 2.

#### See also

`COUNT`, `SUMIF`.

`DEGREES`

`DEGREES`

    DEGREES(x)

#### Description

`DEGREES` computes the number of degrees equivalent to `x` radians.

- This function is Excel compatible.

#### Examples

`DEGREES`(2.5) equals 143.2394.

#### See also

`RADIANS`, `PI`.

`EVEN`

`EVEN`

    EVEN(number)

#### Description

`EVEN` function returns the number rounded up to the nearest even integer. Negative numbers are rounded down.

- This function is Excel compatible.

#### Examples

`EVEN`(5.4) equals 6.

`EVEN`(-5.4) equals -6.

#### See also

`ODD`.

`EXP`

`EXP`

    EXP(x)

#### Description

`EXP` computes the value of e (the base of natural logarithms) raised to the power of `x`.

- This function is Excel compatible.

#### Examples

`EXP`(2) equals 7.389056.

#### See also

`LOG`, `LOG2`, `LOG10`.

`EXPM1`

`EXPM1`

    EXPM1(x)

#### Description

`EXPM1` computes EXP(`x`)-1 with higher resulting precision than the direct formula.

#### Examples

`EXPM1`(0.01) equals 0.01005.

#### See also

`EXP`, `LN1P`.

`FACT`

`FACT`

    FACT(x)

#### Description

`FACT` computes the factorial of `x`. ie, `x`!

- This function is Excel compatible.

#### Examples

`FACT`(3) equals 6.

`FACT`(9) equals 362880.

#### See also

`FACTDOUBLE`

`FACTDOUBLE`

    FACTDOUBLE(number)

#### Description

`FACTDOUBLE` function returns the double factorial of a `number`, i.e., x!!.

- If `number` is not an integer, it is truncated.

- If `number` is negative `FACTDOUBLE` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`FACTDOUBLE`(5) equals 15.

#### See also

`FACT`.

`FIB`

`FIB`

    FIB(number)

#### Description

`FIB` function computes Fibonacci numbers.

- If `number` is not an integer, it is truncated.

- If `number` is negative or zero `FIB` returns #NUM! error.

#### Examples

`FIB`(12) equals 144.

#### See also

`FLOOR`

`FLOOR`

    FLOOR(x[,significance])

#### Description

`FLOOR` function rounds `x` down to the next nearest multiple of `significance`.

- `significance` defaults to 1.

- This function is Excel compatible.

#### Examples

`FLOOR`(0.5) equals 0.

`FLOOR`(5,2) equals 4.

`FLOOR`(-5,-2) equals -4.

`FLOOR`(-5,2) equals #NUM!.

#### See also

`CEIL`, `CEILING`, `ABS`, `INT`, `MOD`.

`G_PRODUCT`

`G_PRODUCT`

    G_PRODUCT(value1, value2, ...)

#### Description

`G_PRODUCT` returns the product of all the values and cells referenced in the argument list.

- Empty cells are ignored and the empty product is 1.

#### Examples

`G_PRODUCT`(2,5,9) equals 90.

#### See also

`SUM`, `COUNT`.

`GCD`

`GCD`

    GCD(number1,number2,...)

#### Description

`GCD` returns the greatest common divisor of given numbers.

- If any of the arguments is less than one, `GCD` returns #NUM! error.

- If any of the arguments is non-integer, it is truncated.

- This function is Excel compatible.

#### Examples

`GCD`(470,770) equals 10.

`GCD`(470,770,1495) equals 5.

#### See also

`LCM`.

`HYPOT`

`HYPOT`

    HYPOT(number1,number2,...)

#### Description

`HYPOT` returns the square root of the sum of the squares of the arguments.

#### Examples

`HYPOT`(3,4) equals to 5.

#### See also

`MIN`, `MAX`.

`INT`

`INT`

    INT(a)

#### Description

`INT` function returns the largest integer that is not bigger than its argument.

- This function is Excel compatible.

#### Examples

`INT`(7.2) equals 7.

`INT`(-5.5) equals -6.

#### See also

`CEIL`, `CEILING`, `FLOOR`, `ABS`, `MOD`.

`LCM`

`LCM`

    LCM(number1,number2,...)

#### Description

`LCM` returns the least common multiple of integers. The least common multiple is the smallest positive number that is a multiple of all integer arguments given.

- If any of the arguments is less than one, `LCM` returns #NUM!.

- If any of the arguments is non-integer, it is truncated.

- This function is Excel compatible.

#### Examples

`LCM`(2,13) equals to 26.

`LCM`(4,7,5) equals to 140.

#### See also

`GCD`.

`LN`

`LN`

    LN(x)

#### Description

`LN` returns the natural logarithm of `x`.

- If `x` <= 0, `LN` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`LN`(7) equals 1.94591.

#### See also

`EXP`, `LOG2`, `LOG10`.

`LN1P`

`LN1P`

    LN1P(x)

#### Description

`LN1P` computes LN(1+`x`) with higher resulting precision than the direct formula.

- If `x` <= -1, `LN1P` returns #NUM! error.

#### Examples

`LN1P`(0.01) equals 0.00995.

#### See also

`LN`, `EXPM1`.

`LOG`

`LOG`

    LOG(x[,base])

#### Description

`LOG` computes the logarithm of `x` in the given base `base`. If no `base` is given `LOG` returns the logarithm in base 10. `base` must be > 0. and cannot equal 1.

- This function is Excel compatible.

#### Examples

`LOG`(2) equals 0.30103.

`LOG`(8192,2) equals 13.

#### See also

`LN`, `LOG2`, `LOG10`.

`LOG10`

`LOG10`

    LOG10(x)

#### Description

`LOG10` computes the base-10 logarithm of `x`.

- If `x` <= 0, `LOG10` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`LOG10`(7) equals 0.845098.

#### See also

`EXP`, `LOG2`, `LOG`.

`LOG2`

`LOG2`

    LOG2(x)

#### Description

`LOG2` computes the base-2 logarithm of `x`.

- If `x` <= 0, `LOG2` returns #NUM! error.

#### Examples

`LOG2`(1024) equals 10.

#### See also

`EXP`, `LOG10`, `LOG`.

`MDETERM`

`MDETERM`

    MDETERM(matrix)

#### Description

`MDETERM` function returns the determinant of a given matrix.

- If the `matrix` does not contain equal number of columns and rows, `MDETERM` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

Let us assume that A1, ..., A4 contain numbers 2, 3, 7, and 3, B1, ..., B4 4, 2, 4, and 1, C1, ..., C4 9, 4, 3, and 2, and D1, ..., D4 7, 3, 6, and 5. Then

`MDETERM`(A1:D4) equals 148.

#### See also

`MMULT`, `MINVERSE`.

`MINVERSE`

`MINVERSE`

    MINVERSE(matrix)

#### Description

`MINVERSE` function returns the inverse matrix of `matrix`.

- If `matrix` cannot be inverted, `MINVERSE` returns #NUM! error.

- If `matrix` does not contain equal number of columns and rows, `MINVERSE` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

#### See also

`MMULT`, `MDETERM`.

`MMULT`

`MMULT`

    MMULT(array1,array2)

#### Description

`MMULT` function returns the matrix product of two arrays. The result is an array with the same number of rows as `array1` and the same number of columns as `array2`.

- This function is Excel compatible.

#### Examples

#### See also

`TRANSPOSE`, `MINVERSE`.

`MOD`

`MOD`

    MOD(number,divisor)

#### Description

`MOD` function returns the remainder when `divisor` is divided into `number`.

- `MOD` returns #DIV/0! if `divisor` is zero.

- This function is Excel compatible.

#### Examples

`MOD`(23,7) equals 2.

#### See also

`CEIL`, `CEILING`, `FLOOR`, `ABS`, `INT`, `ABS`.

`MROUND`

`MROUND`

    MROUND(number,multiple)

#### Description

`MROUND` function rounds a given number to the desired multiple.

`number` is the number you want rounded and `multiple` is the the multiple to which you want to round the number.

- If `number` and `multiple` have different sign, `MROUND` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`MROUND`(1.7,0.2) equals 1.8.

`MROUND`(321.123,0.12) equals 321.12.

#### See also

`ROUNDDOWN`, `ROUND`, `ROUNDUP`.

`MULTINOMIAL`

`MULTINOMIAL`

    MULTINOMIAL(value1, value2, ...)

#### Description

`MULTINOMIAL` returns the ratio of the factorial of a sum of values to the product of factorials.

- This function is Excel compatible.

#### Examples

`MULTINOMIAL`(2,3,4) equals 1260.

#### See also

`SUM`.

`ODD`

`ODD`

    ODD(number)

#### Description

`ODD` function returns the `number` rounded up to the nearest odd integer. Negative numbers are rounded down.

- This function is Excel compatible.

#### Examples

`ODD`(4.4) equals 5.

`ODD`(-4.4) equals -5.

#### See also

`EVEN`.

`PI`

`PI`

    PI()

#### Description

`PI` functions returns the value of pi.

- This function is called with no arguments.

- This function is Excel compatible, except that it returns pi with a better precision.

#### Examples

`PI`() equals about 3.141593.

#### See also

`SQRTPI`.

`POWER`

`POWER`

    POWER(x,y)

#### Description

`POWER` returns the value of `x` raised to the power `y`.

- If both `x` and `y` equals to 0, `POWER` returns #NUM! error.

- If `x` = 0 and `y` < 0, `POWER` returns #DIV/0! error.

- If `x` < 0 and `y` is non-integer, `POWER` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`POWER`(2,7) equals 128.

`POWER`(3,3.141) equals 31.523749.

#### See also

`EXP`.

`PRODUCT`

`PRODUCT`

    PRODUCT(value1, value2, ...)

#### Description

`PRODUCT` returns the product of all the values and cells referenced in the argument list.

- This function is Excel compatible. In particular, this means that if all cells are empty, the result will be 0.

#### Examples

`PRODUCT`(2,5,9) equals 90.

#### See also

`SUM`, `COUNT`, `G_PRODUCT`.

`QUOTIENT`

`QUOTIENT`

    QUOTIENT(numerator,denominator)

#### Description

`QUOTIENT` function returns the integer portion of a division. `numerator` is the divided number and `denominator` is the divisor.

- This function is Excel compatible.

#### Examples

`QUOTIENT`(23,5) equals 4.

#### See also

`MOD`.

`RADIANS`

`RADIANS`

    RADIANS(x)

#### Description

`RADIANS` computes the number of radians equivalent to `x` degrees.

- This function is Excel compatible.

#### Examples

`RADIANS`(180) equals 3.14159.

#### See also

`PI`, `DEGREES`.

`ROMAN`

`ROMAN`

    ROMAN(number[,type])

#### Description

`ROMAN` function returns an arabic number in the roman numeral style, as text. `number` is the number you want to convert and `type` is the type of roman numeral you want.

- If `type` is 0 or it is omitted, `ROMAN` returns classic roman numbers.

- Type 1 is more concise than classic type, type 2 is more concise than type 1, and type 3 is more concise than type 2. Type 4 is simplified type.

- If `number` is negative or greater than 3999, `ROMAN` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`ROMAN`(999) equals CMXCIX.

`ROMAN`(999,1) equals LMVLIV.

`ROMAN`(999,2) equals XMIX.

`ROMAN`(999,3) equals VMIV.

`ROMAN`(999,4) equals IM.

#### See also

`ROUND`

`ROUND`

    ROUND(number[,digits])

#### Description

`ROUND` function rounds a given number.

`number` is the number you want rounded and `digits` is the number of digits to which you want to round that number.

- If `digits` is greater than zero, `number` is rounded to the given number of digits.

- If `digits` is zero or omitted, `number` is rounded to the nearest integer.

- If `digits` is less than zero, `number` is rounded to the left of the decimal point.

- This function is Excel compatible.

#### Examples

`ROUND`(5.5) equals 6.

`ROUND`(-3.3) equals -3.

`ROUND`(1501.15,1) equals 1501.2.

`ROUND`(1501.15,-2) equals 1500.0.

#### See also

`ROUNDDOWN`, `ROUNDUP`.

`ROUNDDOWN`

`ROUNDDOWN`

    ROUNDDOWN(number[,digits])

#### Description

`ROUNDDOWN` function rounds a given `number` down. `number` is the number you want rounded down and `digits` is the number of digits to which you want to round that number.

- If `digits` is greater than zero, `number` is rounded down to the given number of digits.

- If `digits` is zero or omitted, `number` is rounded down to the nearest integer.

- If `digits` is less than zero, `number` is rounded down to the left of the decimal point.

- This function is Excel compatible.

#### Examples

`ROUNDDOWN`(5.5) equals 5.

`ROUNDDOWN`(-3.3) equals -4.

`ROUNDDOWN`(1501.15,1) equals 1501.1.

`ROUNDDOWN`(1501.15,-2) equals 1500.0.

#### See also

`ROUND`, `ROUNDUP`.

`ROUNDUP`

`ROUNDUP`

    ROUNDUP(number[,digits])

#### Description

`ROUNDUP` function rounds a given number up.

`number` is the number you want rounded up and `digits` is the number of digits to which you want to round that number.

- If `digits` is greater than zero, `number` is rounded up to the given number of digits.

- If `digits` is zero or omitted, `number` is rounded up to the nearest integer.

- If `digits` is less than zero, `number` is rounded up to the left of the decimal point.

- This function is Excel compatible.

#### Examples

`ROUNDUP`(5.5) equals 6.

`ROUNDUP`(-3.3) equals -3.

`ROUNDUP`(1501.15,1) equals 1501.2.

`ROUNDUP`(1501.15,-2) equals 1600.0.

#### See also

`ROUND`, `ROUNDDOWN`.

`SERIESSUM`

`SERIESSUM`

    SERIESSUM(x,n,m,coefficients)

#### Description

`SERIESSUM` function returns the sum of a power series. `x` is the base of the power series, `n` is the initial power to raise `x`, `m` is the increment to the power for each term in the series, and `coefficients` are the coefficients by which each successive power of `x` is multiplied.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 1.23, 2.32, 2.98, 3.42, and 4.33. Then

`SERIESSUM`(3,1,2.23,A1:A5) equals 251416.43018.

#### See also

`COUNT`, `SUM`.

`SIGN`

`SIGN`

    SIGN(number)

#### Description

`SIGN` function returns 1 if the `number` is positive, zero if the `number` is 0, and -1 if the `number` is negative.

- This function is Excel compatible.

#### Examples

`SIGN`(3) equals 1.

`SIGN`(-3) equals -1.

`SIGN`(0) equals 0.

#### See also

`SIN`

`SIN`

    SIN(x)

#### Description

`SIN` function returns the sine of `x`, where `x` is given in radians.

- This function is Excel compatible.

#### Examples

`SIN`(0.5) equals 0.479426.

#### See also

`COS`, `COSH`, `SINH`, `TAN`, `TANH`, `RADIANS`, `DEGREES`.

`SINH`

`SINH`

    SINH(x)

#### Description

`SINH` function returns the hyperbolic sine of `x`, which is defined mathematically as

(exp(`x`) - exp(-`x`)) / 2.

- This function is Excel compatible.

#### Examples

`SINH`(0.5) equals 0.521095.

#### See also

`SIN`, `COS`, `COSH`, `TAN`, `TANH`, `DEGREES`, `RADIANS`, `EXP`.

`SQRT`

`SQRT`

    SQRT(x)

#### Description

`SQRT` function returns the square root of `x`.

- If `x` is negative, `SQRT` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`SQRT`(2) equals 1.4142136.

#### See also

`POWER`.

`SQRTPI`

`SQRTPI`

    SQRTPI(number)

#### Description

`SQRTPI` function returns the square root of a `number` multiplied by pi.

- This function is Excel compatible.

#### Examples

`SQRTPI`(2) equals 2.506628275.

#### See also

`PI`.

`SUM`

`SUM`

    SUM(value1, value2, ...)

#### Description

`SUM` computes the sum of all the values and cells referenced in the argument list.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11, 15, 17, 21, and 43. Then

`SUM`(A1:A5) equals 107.

#### See also

`AVERAGE`, `COUNT`.

`SUMA`

`SUMA`

    SUMA(value1, value2, ...)

#### Description

`SUMA` computes the sum of all the values and cells referenced in the argument list. Numbers, text and logical values are included in the calculation too. If the cell contains text or the argument evaluates to FALSE, it is counted as value zero (0). If the argument evaluates to TRUE, it is counted as one (1).

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11, 15, 17, 21, and 43. Then

`SUMA`(A1:A5) equals 107.

#### See also

`AVERAGE`, `SUM`, `COUNT`.

`SUMIF`

`SUMIF`

    SUMIF(range,criteria[,actual_range])

#### Description

`SUMIF` function sums the values in the given `range` that meet the given `criteria`. If `actual_range` is given, `SUMIF` sums the values in the `actual_range` whose corresponding components in `range` meet the given `criteria`.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 23, 27, 28, 33, and 39. Then

`SUMIF`(A1:A5,"<=28") equals 78.

`SUMIF`(A1:A5,"<28") equals 50.

In addition, if the cells B1, B2, ..., B5 hold numbers 5, 3, 2, 6, and 7 then:

`SUMIF`(A1:A5,"<=27",B1:B5) equals 8.

#### See also

`COUNTIF`, `SUM`.

`SUMPRODUCT`

`SUMPRODUCT`

    SUMPRODUCT(range1,range2,...)

#### Description

`SUMPRODUCT` function multiplies corresponding data entries in the given arrays or ranges, and then returns the sum of those products. If an array entry is not numeric, the value zero is used instead.

- If arrays or range arguments do not have the same dimensions, `SUMPRODUCT` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11, 15, 17, 21, and 43 and the cells B1, B2, ..., B5 hold numbers 13, 22, 31, 33, and 39. Then

`SUMPRODUCT`(A1:A5,B1:B5) equals 3370.

#### See also

`SUM`, `PRODUCT`.

`SUMSQ`

`SUMSQ`

    SUMSQ(value1, value2, ...)

#### Description

`SUMSQ` returns the sum of the squares of all the values and cells referenced in the argument list.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11, 15, 17, 21, and 43. Then

`SUMSQ`(A1:A5) equals 2925.

#### See also

`SUM`, `COUNT`.

`SUMX2MY2`

`SUMX2MY2`

    SUMX2MY2(array1,array2)

#### Description

`SUMX2MY2` function returns the sum of the difference of squares of corresponding values in two arrays. `array1` is the first array or range of data points and `array2` is the second array or range of data points. The equation of `SUMX2MY2` is SUM (x^2-y^2).

- Strings and empty cells are simply ignored.

- If `array1` and `array2` have different number of data points, `SUMX2MY2` returns #N/A error.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11, 15, 17, 21, and 43 and the cells B1, B2, ..., B5 hold numbers 13, 22, 31, 33, and 39. Then

`SUMX2MY2`(A1:A5,B1:B5) equals -1299.

#### See also

`SUMSQ`, `SUMX2PY2`.

`SUMX2PY2`

`SUMX2PY2`

    SUMX2PY2(array1,array2)

#### Description

`SUMX2PY2` function returns the sum of the sum of squares of corresponding values in two arrays. `array1` is the first array or range of data points and `array2` is the second array or range of data points. The equation of `SUMX2PY2` is SUM (x^2+y^2).

- Strings and empty cells are simply ignored.

- If `array1` and `array2` have different number of data points, `SUMX2PY2` returns #N/A error.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11, 15, 17, 21, and 43 and the cells B1, B2, ..., B5 hold numbers 13, 22, 31, 33, and 39. Then

`SUMX2PY2`(A1:A5,B1:B5) equals 7149.

#### See also

`SUMSQ`, `SUMX2MY2`.

`SUMXMY2`

`SUMXMY2`

    SUMXMY2(array1,array2)

#### Description

`SUMXMY2` function returns the sum of squares of differences of corresponding values in two arrays. `array1` is the first array or range of data points and `array2` is the second array or range of data points. The equation of `SUMXMY2` is SUM (x-y)^2.

- Strings and empty cells are simply ignored.

- If `array1` and `array2` have different number of data points, `SUMXMY2` returns #N/A error.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11, 15, 17, 21, and 43 and the cells B1, B2, ..., B5 hold numbers 13, 22, 31, 33, and 39. Then

`SUMXMY2`(A1:A5,B1:B5) equals 409.

#### See also

`SUMSQ`, `SUMX2MY2`, `SUMX2PY2`.

`TAN`

`TAN`

    TAN(x)

#### Description

`TAN` function returns the tangent of `x`, where `x` is given in radians.

- This function is Excel compatible.

#### Examples

`TAN`(3) equals -0.1425465.

#### See also

`TANH`, `COS`, `COSH`, `SIN`, `SINH`, `DEGREES`, `RADIANS`.

`TANH`

`TANH`

    TANH(x)

#### Description

`TANH` function returns the hyperbolic tangent of `x`, which is defined mathematically as

sinh(`x`) / cosh(`x`).

- This function is Excel compatible.

#### Examples

`TANH`(2) equals 0.96402758.

#### See also

`TAN`, `SIN`, `SINH`, `COS`, `COSH`, `DEGREES`, `RADIANS`.

`TRUNC`

`TRUNC`

    TRUNC(number[,digits])

#### Description

`TRUNC` function returns the value of `number` truncated to the number of digits specified.

- If `digits` is omitted or negative then `digits` defaults to zero.

- If `digits` is not an integer, it is truncated.

- This function is Excel compatible.

#### Examples

`TRUNC`(3.12) equals 3.

`TRUNC`(4.15,1) equals 4.1.

#### See also

`INT`.

## Number Theory

`ISPRIME`

`ISPRIME`

    ISPRIME(i)

#### Description

`ISPRIME` function returns TRUE if `i` is prime and FALSE otherwise.

#### See also

`ITHPRIME`, `NT_D`, `NT_SIGMA`.

`ITHPRIME`

`ITHPRIME`

    ITHPRIME(i)

#### Description

`ITHPRIME` function returns the `ith` prime.

#### Examples

#### See also

`NT_D`, `NT_SIGMA`.

`NT_D`

`NT_D`

    NT_D(n)

#### Description

`NT_D` function calculates the number of divisors of `n`.

#### Examples

#### See also

`ITHPRIME`, `NT_PHI`, `NT_SIGMA`.

`NT_MU`

`NT_MU`

    NT_MU(n)

#### Description

`NT_MU` function (Möbius mu function) returns

0 if `n` is divisible by the square of a prime .

Otherwise it returns:

-1 if `n` has an odd number of different prime factors .

1 if `n` has an even number of different prime factors .

- If `n` = 1 `NT_MU` returns 1.

#### Examples

#### See also

`NT_D`, `ITHPRIME`, `NT_PHI`.

`NT_PHI`

`NT_PHI`

    NT_PHI(n)

#### Description

`NT_PHI` function calculates the number of integers less than or equal to `n` that are relatively prime to `n`.

#### Examples

#### See also

`NT_D`, `ITHPRIME`, `NT_SIGMA`.

`NT_PI`

`NT_PI`

    NT_PI(n)

#### Description

`NT_PI` function returns the number of primes less than or equal to `n`.

#### See also

`ITHPRIME`, `NT_PHI`, `NT_D`, `NT_SIGMA`.

`NT_SIGMA`

`NT_SIGMA`

    NT_SIGMA(n)

#### Description

`NT_SIGMA` function calculates the sum of the divisors of `n`.

#### Examples

#### See also

`NT_D`, `ITHPRIME`, `NT_PHI`.

`PFACTOR`

`PFACTOR`

    PFACTOR(n)

#### Description

`PFACTOR` function returns the smallest prime factor of its argument.

The argument must be at least 2, or else a #VALUE! error is returned.

#### See also

`ITHPRIME`.

## Random Numbers

`RAND`

`RAND`

    RAND()

#### Description

`RAND` returns a random number between zero and one.

- This function is Excel compatible.

#### Examples

`RAND`() returns a random number greater than zero but less than one.

#### See also

`RANDBETWEEN`.

`RANDBERNOULLI`

`RANDBERNOULLI`

    RANDBERNOULLI(p)

#### Description

`RANDBERNOULLI` returns a Bernoulli-distributed random number.

- If `p` < 0 or `p` > 1 `RANDBERNOULLI` returns #NUM! error.

#### Examples

`RANDBERNOULLI`(0.5).

#### See also

`RAND`, `RANDBETWEEN`.

`RANDBETA`

`RANDBETA`

    RANDBETA(a,b)

#### Description

`RANDBETA` returns a Beta-distributed random number.

#### Examples

`RANDBETA`(1,2).

#### See also

`RAND`, `RANDGAMMA`.

`RANDBETWEEN`

`RANDBETWEEN`

    RANDBETWEEN(bottom,top)

#### Description

`RANDBETWEEN` function returns a random integer number between and including `bottom` and `top`.

- If `bottom` or `top` is non-integer, they are truncated.

- If `bottom` > `top`, `RANDBETWEEN` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`RANDBETWEEN`(3,7).

#### See also

`RAND`, `RANDUNIFORM`.

`RANDBINOM`

`RANDBINOM`

    RANDBINOM(p,trials)

#### Description

`RANDBINOM` returns a binomially-distributed random number.

- If `p` < 0 or `p` > 1 `RANDBINOM` returns #NUM! error.

- If `trials` < 0 `RANDBINOM` returns #NUM! error.

#### Examples

`RANDBINOM`(0.5,2).

#### See also

`RAND`, `RANDBETWEEN`.

`RANDCAUCHY`

`RANDCAUCHY`

    RANDCAUCHY(a)

#### Description

`RANDCAUCHY` returns a Cauchy-distributed random number with scale parameter a. The Cauchy distribution is also known as the Lorentz distribution.

- If `a` < 0 `RANDCAUCHY` returns #NUM! error.

#### Examples

`RANDCAUCHY`(1).

#### See also

`RAND`.

`RANDCHISQ`

`RANDCHISQ`

    RANDCHISQ(nu)

#### Description

`RANDCHISQ` returns a Chi-Square-distributed random number.

#### Examples

`RANDCHISQ`(0.5).

#### See also

`RAND`, `RANDGAMMA`.

`RANDDISCRETE`

`RANDDISCRETE`

    RANDDISCRETE(val_range[,prob_range])

#### Description

`RANDDISCRETE` returns one of the values in the `val_range`. The probabilities for each value are given in the `prob_range`.

- If `prob_range` is omitted, the uniform discrete distribution is assumed.

- If the sum of all values in `prob_range` is other than one, `RANDDISCRETE` returns #NUM! error.

- If `val_range` and `prob_range` are not the same size, `RANDDISCRETE` returns #NUM! error.

- If `val_range` or `prob_range` is not a range, `RANDDISCRETE` returns #VALUE! error.

#### Examples

`RANDDISCRETE`(A1:A6) returns one of the values in the range A1:A6.

#### See also

`RANDBETWEEN`, `RAND`.

`RANDEXP`

`RANDEXP`

    RANDEXP(b)

#### Description

`RANDEXP` returns a exponentially-distributed random number.

#### Examples

`RANDEXP`(0.5).

#### See also

`RAND`, `RANDBETWEEN`.

`RANDEXPPOW`

`RANDEXPPOW`

    RANDEXPPOW(a,b)

#### Description

`RANDEXPPOW` returns a random variate from the exponential power distribution with scale parameter `a` and exponent `b`. The distribution is,

p(x) dx = {1 over 2 a Gamma(1+1/b)} exp(-|x/a|^b) dx, for x >= 0.

- For `b` = 1 this reduces to the Laplace distribution.

- For `b` = 2 it has the same form as a normal distribution with sigma = a/sqrt(2).

#### Examples

`RANDEXPPOW`(0.5,0.1).

#### See also

`RAND`.

`RANDFDIST`

`RANDFDIST`

    RANDFDIST(nu1,nu2)

#### Description

`RANDFDIST` returns a F-distributed random number.

#### Examples

`RANDFDIST`(1,2).

#### See also

`RAND`, `RANDGAMMA`.

`RANDGAMMA`

`RANDGAMMA`

    RANDGAMMA(a,b)

#### Description

`RANDGAMMA` returns a Gamma-distributed random number.

- If `a` <= 0 `RANDGAMMA` returns #NUM! error.

#### Examples

`RANDGAMMA`(1,2).

#### See also

`RAND`.

`RANDGEOM`

`RANDGEOM`

    RANDGEOM(p)

#### Description

`RANDGEOM` returns a geometric-distributed random number. The number of independent trials with probability `p` until the first success. The probability distribution for geometric variates is,

p(k) = p (1-p)^(k-1), for k >= 1.

- If `p` < 0 or `p` > 1 `RANDGEOM` returns #NUM! error.

#### Examples

`RANDGEOM`(0.4).

#### See also

`RAND`.

`RANDGUMBEL`

`RANDGUMBEL`

    RANDGUMBEL(a,b[,type])

#### Description

`RANDGUMBEL` returns a Type I or Type II Gumbel-distributed random number. `type` is either 1 or 2 and specifies the type of the distribution (Type I or Type II).

- If `type` is neither 1 nor 2, `RANDGUMBEL` returns #NUM! error.

- If `type` is omitted, Type I is assumed.

#### Examples

`RANDGUMBEL`(0.5,1,2).

#### See also

`RAND`.

`RANDHYPERG`

`RANDHYPERG`

    RANDHYPERG(n1,n2,t)

#### Description

`RANDHYPERG` returns a hypergeometric-distributed random number. The probability distribution for hypergeometric random variates is,

p(k) = C(n_1,k) C(n_2, t-k) / C(n_1 + n_2,k),

where C(a,b) = a!/(b!(a-b)!).

The domain of k is max(0,t-n_2), ..., max(t,n_1).

#### Examples

`RANDHYPERG`(21,1,9).

#### See also

`RAND`.

`RANDLANDAU`

`RANDLANDAU`

    RANDLANDAU()

#### Description

`RANDLANDAU` returns a random variate from the Landau distribution. The probability distribution for Landau random variates is defined analytically by the complex integral,

p(x) = (1/(2 pi i)) int_{c-i infty}^{c+i infty} ds exp(s log(s) + x s).

For numerical purposes it is more convenient to use the following equivalent form of the integral,

p(x) = (1/pi) int_0^ infty dt exp(-t log(t) - x t) sin(pi t).

#### Examples

`RANDLANDAU`().

#### See also

`RAND`.

`RANDLAPLACE`

`RANDLAPLACE`

    RANDLAPLACE(a)

#### Description

`RANDLAPLACE` returns a Laplace-distributed random number. Laplace distribution is also known as two-sided exponential probability distribution.

#### Examples

`RANDLAPLACE`(1).

#### See also

`RAND`.

`RANDLEVY`

`RANDLEVY`

    RANDLEVY(c,alpha[,beta])

#### Description

`RANDLEVY` returns a Levy-distributed random number. If `beta` is omitted, it is assumed to be 0.

- For `alpha` = 1, `beta`=0, we get the Lorentz distribution.

- For `alpha` = 2, `beta`=0, we get the normal distribution.

- If `alpha` <= 0 or `alpha` > 2, `RANDLEVY` returns #NUM! error.

- If `beta` < -1 or `beta` > 1, `RANDLEVY` returns #NUM! error.

#### Examples

`RANDLEVY`(0.5,0.1,1).

#### See also

`RAND`.

`RANDLOG`

`RANDLOG`

    RANDLOG(p)

#### Description

`RANDLOG` returns a logarithmic-distributed random number.

- If `p` < 0 or `p` > 1 `RANDLOG` returns #NUM! error.

#### Examples

`RANDLOG`(0.72).

#### See also

`RAND`.

`RANDLOGISTIC`

`RANDLOGISTIC`

    RANDLOGISTIC(a)

#### Description

`RANDLOGISTIC` returns a logistic-distributed random number. The distribution function is,

p(x) dx = { exp(-x/a) over a (1 + exp(-x/a))^2 } dx for -infty < x < +infty.

#### Examples

`RANDLOGISTIC`(1).

#### See also

`RAND`.

`RANDLOGNORM`

`RANDLOGNORM`

    RANDLOGNORM(zeta,sigma)

#### Description

`RANDLOGNORM` returns a lognormal-distributed random number.

#### Examples

`RANDLOGNORM`(1,2).

#### See also

`RAND`.

`RANDNEGBINOM`

`RANDNEGBINOM`

    RANDNEGBINOM(p,failures)

#### Description

`RANDNEGBINOM` returns a negative binomially-distributed random number.

- If `p` < 0 or `p` > 1, `RANDNEGBINOM` returns #NUM! error.

- If `failures` < 1, `RANDNEGBINOM` returns #NUM! error.

#### Examples

`RANDNEGBINOM`(0.5,2).

#### See also

`RAND`, `RANDBETWEEN`.

`RANDNORM`

`RANDNORM`

    RANDNORM(mean,stdev)

#### Description

`RANDNORM` returns a normal-distributed random number.

- If `stdev` < 0 `RANDNORM` returns #NUM! error.

#### Examples

`RANDNORM`(0,1).

#### See also

`RAND`.

`RANDNORMTAIL`

`RANDNORMTAIL`

    RANDNORMTAIL(a,sigma)

#### Description

`RANDNORMTAIL` returns a random variates from the upper tail of a normal distribution with standard deviation `sigma`. The values returned are larger than the lower limit `a`, which must be positive. The method is based on Marsaglia's famous rectangle-wedge-tail algorithm (Ann Math Stat 32, 894-899 (1961)), with this aspect explained in Knuth, v2, 3rd ed, p139, 586 (exercise 11).

The probability distribution for normal tail random variates is,

p(x) dx = {1 over N(a;sigma)} exp (- x^2/(2 sigma^2)) dx,

for x > a where N(a;sigma) is the normalization constant, N(a;sigma) = (1/2) erfc(a / sqrt(2 sigma^2)).

#### Examples

`RANDNORMTAIL`(0.5,0.1).

#### See also

`RAND`.

`RANDPARETO`

`RANDPARETO`

    RANDPARETO(a,b)

#### Description

`RANDPARETO` returns a Pareto-distributed random number.

#### Examples

`RANDPARETO`(1,2).

#### See also

`RAND`.

`RANDPOISSON`

`RANDPOISSON`

    RANDPOISSON(lambda)

#### Description

`RANDPOISSON` returns a Poisson-distributed random number.

- If `lambda` < 0 `RANDPOISSON` returns #NUM! error.

#### Examples

`RANDPOISSON`(3).

#### See also

`RAND`, `RANDBETWEEN`.

`RANDRAYLEIGH`

`RANDRAYLEIGH`

    RANDRAYLEIGH(sigma)

#### Description

`RANDRAYLEIGH` returns a Rayleigh-distributed random number.

#### Examples

`RANDRAYLEIGH`(1).

#### See also

`RAND`.

`RANDRAYLEIGHTAIL`

`RANDRAYLEIGHTAIL`

    RANDRAYLEIGHTAIL(a,sigma)

#### Description

`RANDRAYLEIGHTAIL` returns a random variate from the tail of the Rayleigh distribution with scale parameter sigma and a lower limit of a. The distribution is,

p(x) dx = {x over sigma^2} exp ((a^2 - x^2) /(2 sigma^2)) dx,

for x > a.

#### Examples

`RANDRAYLEIGHTAIL`(0.3,1).

#### See also

`RAND`, `RANDRAYLEIGH`.

`RANDTDIST`

`RANDTDIST`

    RANDTDIST(nu)

#### Description

`RANDTDIST` returns a T-distributed random number.

#### Examples

`RANDTDIST`(0.5).

#### See also

`RAND`.

`RANDUNIFORM`

`RANDUNIFORM`

    RANDUNIFORM(a,b)

#### Description

`RANDUNIFORM` returns a random variate from the uniform (flat) distribution from a to b. The distribution is,

p(x) dx = {1 over (b-a)} dx : for a <= x < b.

p(x) dx = 0 : for x < a or b <= x.

- If `a` > `b` `RANDUNIFORM` returns #NUM! error.

#### Examples

`RANDUNIFORM`(1.4,4.2) returns a random number greater than or equal to 1.4 but less than 4.2.

#### See also

`RANDBETWEEN`, `RAND`.

`RANDWEIBULL`

`RANDWEIBULL`

    RANDWEIBULL(a,b)

#### Description

`RANDWEIBULL` returns a Weibull-distributed random number.

#### Examples

`RANDWEIBULL`(1,2).

#### See also

`RAND`.

`SIMTABLE`

`SIMTABLE`

    SIMTABLE(d1, d2, ..., dN)

#### Description

`SIMTABLE` returns one of the values in the given argument list depending on the round number of the simulation tool. When the simulation tool is not activated, `SIMTABLE` returns `d1`.

With the simulation tool and the `SIMTABLE` function you can test given decision variables. Each `SIMTABLE` function contains the possible values of a simulation variable. In most valid simulation models you should have the same number of values `dN` for all decision variables. If the simulation is run more rounds than there are values defined, `SIMTABLE` returns #N/A! error (e.g. if A1 contains `=`SIMTABLE`(1)' and A2 `=`SIMTABLE`(1,2)', A1 yields #N/A! error on the second round).

The successive use of the simulation tool also requires that you give to the tool at least one input variable having RAND() or any other RAND<distribution name>() function in it. On each round, the simulation tool iterates for the given number of rounds over all the input variables to reevaluate them. On each iteration, the values of the output variables are stored, and when the round is completed, descriptive statistical information is created according to the values.

#### Examples

`SIMTABLE`(TRUE,FALSE) returns TRUE on the first simulation round and FALSE on the second round.

`SIMTABLE`(223,225,227,229) returns 227 on the simulation round #3.

#### See also

## Statistics

`AVEDEV`

`AVEDEV`

    AVEDEV(n1, n2, ...)

#### Description

`AVEDEV` returns the average of the absolute deviations of a data set from their mean.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`AVEDEV`(A1:A5) equals 7.84.

#### See also

`STDEV`.

`AVERAGE`

`AVERAGE`

    AVERAGE(value1, value2,...)

#### Description

`AVERAGE` computes the average of all the values and cells referenced in the argument list. This is equivalent to the sum of the arguments divided by the count of the arguments.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`AVERAGE`(A1:A5) equals 23.2.

#### See also

`SUM`, `COUNT`.

`AVERAGEA`

`AVERAGEA`

    AVERAGEA(number1,number2,...)

#### Description

`AVERAGEA` returns the average of the given arguments. Numbers, text and logical values are included in the calculation too. If the cell contains text or the argument evaluates to FALSE, it is counted as value zero (0). If the argument evaluates to TRUE, it is counted as one (1). Note that empty cells are not counted.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers and strings 11.4, 17.3, "missing", 25.9, and 40.1. Then

`AVERAGEA`(A1:A5) equals 18.94.

#### See also

`AVERAGE`.

`BERNOULLI`

`BERNOULLI`

    BERNOULLI(k,p)

#### Description

`BERNOULLI` returns the probability p(k) of obtaining `k` from a Bernoulli distribution with probability parameter `p`.

- If `k` != 0 and `k` != 1 `BERNOULLI` returns #NUM! error.

- If `p` < 0 or `p` > 1 `BERNOULLI` returns #NUM! error.

#### Examples

`BERNOULLI`(0,0.5).

#### See also

`RANDBERNOULLI`.

`BETADIST`

`BETADIST`

    BETADIST(x,alpha,beta[,a,b])

#### Description

`BETADIST` function returns the cumulative beta distribution. `a` is the optional lower bound of `x` and `b` is the optional upper bound of `x`.

- If `a` is not given, `BETADIST` uses 0.

- If `b` is not given, `BETADIST` uses 1.

- If `x` < `a` or `x` > `b` `BETADIST` returns #NUM! error.

- If `alpha` <= 0 or `beta` <= 0, `BETADIST` returns #NUM! error.

- If `a` >= `b` `BETADIST` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`BETADIST`(0.12,2,3) equals 0.07319808.

#### See also

`BETAINV`.

`BETAINV`

`BETAINV`

    BETAINV(p,alpha,beta[,a,b])

#### Description

`BETAINV` function returns the inverse of cumulative beta distribution. `a` is the optional lower bound of `x` and `b` is the optional upper bound of `x`.

- If `a` is not given, `BETAINV` uses 0.

- If `b` is not given, `BETAINV` uses 1.

- If `p` < 0 or `p` > 1 `BETAINV` returns #NUM! error.

- If `alpha` <= 0 or `beta` <= 0, `BETAINV` returns #NUM! error.

- If `a` >= `b` `BETAINV` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`BETAINV`(0.45,1.6,1) equals 0.607096629.

#### See also

`BETADIST`.

`BINOMDIST`

`BINOMDIST`

    BINOMDIST(n,trials,p,cumulative)

#### Description

`BINOMDIST` function returns the binomial distribution. `n` is the number of successes, `trials` is the total number of independent trials, `p` is the probability of success in trials, and `cumulative` describes whether to return the sum of the binomial function from 0 to `n`.

- If `n` or `trials` are non-integer they are truncated.

- If `n` < 0 or `trials` < 0 `BINOMDIST` returns #NUM! error.

- If `n` > `trials` `BINOMDIST` returns #NUM! error.

- If `p` < 0 or `p` > 1 `BINOMDIST` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`BINOMDIST`(3,5,0.8,0) equals 0.2048.

#### See also

`POISSON`.

`CAUCHY`

`CAUCHY`

    CAUCHY(x,a,cum)

#### Description

`CAUCHY` returns the Cauchy distribution with scale parameter `a`. If `cum` is TRUE, `CAUCHY` returns the cumulative distribution.

- If `a` < 0 `CAUCHY` returns #NUM! error.

- If `cum` != TRUE and `cum` != FALSE `CAUCHY` returns #VALUE! error.

#### Examples

`CAUCHY`(0.43,1,TRUE) returns 0.370735.

#### See also

`RANDCAUCHY`.

`CHIDIST`

`CHIDIST`

    CHIDIST(x,dof)

#### Description

`CHIDIST` function returns the one-tailed probability of the chi-squared distribution. `dof` is the number of degrees of freedom.

- If `dof` is non-integer it is truncated.

- If `dof` < 1 `CHIDIST` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`CHIDIST`(5.3,2) equals 0.070651213.

#### See also

`CHIINV`, `CHITEST`.

`CHIINV`

`CHIINV`

    CHIINV(p,dof)

#### Description

`CHIINV` function returns the inverse of the one-tailed probability of the chi-squared distribution.

- If `p` < 0 or `p` > 1 or `dof` < 1 `CHIINV` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`CHIINV`(0.98,7) equals 1.564293004.

#### See also

`CHIDIST`, `CHITEST`.

`CHITEST`

`CHITEST`

    CHITEST(actual_range,theoretical_range)

#### Description

`CHITEST` function returns the test for independence of chi-squared distribution.

`actual_range` is a range that contains the observed data points. `theoretical_range` is a range that contains the expected values of the data points.

- This function is Excel compatible.

#### Examples

#### See also

`CHIDIST`, `CHIINV`.

`CONFIDENCE`

`CONFIDENCE`

    CONFIDENCE(x,stddev,size)

#### Description

`CONFIDENCE` function returns the confidence interval for a mean. `x` is the significance level, `stddev` is the population standard deviation, and `size` is the size of the sample.

- If `size` is non-integer it is truncated.

- If `size` < 0 `CONFIDENCE` returns #NUM! error.

- If `size` is 0 `CONFIDENCE` returns #DIV/0! error.

- This function is Excel compatible.

#### Examples

`CONFIDENCE`(0.05,1,33) equals 0.341185936.

#### See also

`AVERAGE`.

`CORREL`

`CORREL`

    CORREL(array1,array2)

#### Description

`CORREL` returns the correlation coefficient of two data sets.

- Strings and empty cells are simply ignored.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1, and the cells B1, B2, ... B5 23.2, 25.8, 29.9, 33.5, and 42.7. Then

`CORREL`(A1:A5,B1:B5) equals 0.996124788.

#### See also

`COVAR`, `FISHER`, `FISHERINV`.

`COUNT`

`COUNT`

    COUNT(b1, b2, ...)

#### Description

`COUNT` returns the total number of integer or floating point arguments passed.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`COUNT`(A1:A5) equals 5.

#### See also

`AVERAGE`.

`COUNTA`

`COUNTA`

    COUNTA(b1, b2, ...)

#### Description

`COUNTA` returns the number of arguments passed not including empty cells.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers and strings 11.4, "missing", "missing", 25.9, and 40.1. Then

`COUNTA`(A1:A5) equals 5.

#### See also

`AVERAGE`, `COUNT`, `DCOUNT`, `DCOUNTA`, `PRODUCT`, `SUM`.

`COVAR`

`COVAR`

    COVAR(array1,array2)

#### Description

`COVAR` returns the covariance of two data sets.

- Strings and empty cells are simply ignored.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1, and the cells B1, B2, ... B5 23.2, 25.8, 29.9, 33.5, and 42.7. Then

`COVAR`(A1:A5,B1:B5) equals 65.858.

#### See also

`CORREL`, `FISHER`, `FISHERINV`.

`CRITBINOM`

`CRITBINOM`

    CRITBINOM(trials,p,alpha)

#### Description

`CRITBINOM` function returns the smallest value for which the cumulative is greater than or equal to a given value. `n` is the number of trials, `p` is the probability of success in trials, and `alpha` is the criterion value.

- If `trials` is a non-integer it is truncated.

- If `trials` < 0 `CRITBINOM` returns #NUM! error.

- If `p` < 0 or `p` > 1 `CRITBINOM` returns #NUM! error.

- If `alpha` < 0 or `alpha` > 1 `CRITBINOM` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`CRITBINOM`(10,0.5,0.75) equals 6.

#### See also

`BINOMDIST`.

`CRONBACH`

`CRONBACH`

    CRONBACH(ref1,ref2,...)

#### Description

`CRONBACH` returns Cronbach's alpha for the given cases.

`ref1` is a data set, `ref2` the second data set, etc..

#### Examples

#### See also

`DEVSQ`

`DEVSQ`

    DEVSQ(n1, n2, ...)

#### Description

`DEVSQ` returns the sum of squares of deviations of a data set from the sample mean.

- Strings and empty cells are simply ignored.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`DEVSQ`(A1:A5) equals 470.56.

#### See also

`STDEV`.

`EXPONDIST`

`EXPONDIST`

    EXPONDIST(x,y,cumulative)

#### Description

`EXPONDIST` function returns the exponential distribution. If the `cumulative` boolean is false it will return:

`y` * exp (-`y`*`x`),

otherwise it will return

1 - exp (-`y`*`x`).

- If `x` < 0 or `y` <= 0 this will return an error.

- This function is Excel compatible.

#### Examples

`EXPONDIST`(2,4,0) equals 0.001341851.

#### See also

`POISSON`.

`EXPPOWDIST`

`EXPPOWDIST`

    EXPPOWDIST(x,a,b)

#### Description

`EXPPOWDIST` returns the probability density p(x) at `x` for Exponential Power distribution with scale parameter `a` and exponent `b`.

#### Examples

`EXPPOWDIST`(0.4,1,2).

#### See also

`RANDEXPPOW`.

`FDIST`

`FDIST`

    FDIST(x,dof1,dof2)

#### Description

`FDIST` function returns the F probability distribution. `dof1` is the numerator degrees of freedom and `dof2` is the denominator degrees of freedom.

- If `x` < 0 `FDIST` returns #NUM! error.

- If `dof1` < 1 or `dof2` < 1, `FDIST` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`FDIST`(2,5,5) equals 0.232511319.

#### See also

`FINV`.

`FINV`

`FINV`

    FINV(p,dof1,dof2)

#### Description

`FINV` function returns the inverse of the F probability distribution.

- If `p` < 0 or `p` > 1 `FINV` returns #NUM! error.

- If `dof1` < 1 or `dof2` < 1 `FINV` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`FINV`(0.2,2,4) equals 2.472135955.

#### See also

`FDIST`.

`FISHER`

`FISHER`

    FISHER(x)

#### Description

`FISHER` function returns the Fisher transformation at `x`.

- If `x` is not a number, `FISHER` returns #VALUE! error.

- If `x` <= -1 or `x` >= 1, `FISHER` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`FISHER`(0.332) equals 0.345074339.

#### See also

`SKEW`.

`FISHERINV`

`FISHERINV`

    FISHERINV(x)

#### Description

`FISHERINV` function returns the inverse of the Fisher transformation at `x`.

- If `x` is non-number `FISHERINV` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`FISHERINV`(2) equals 0.96402758.

#### See also

`FISHER`.

`FORECAST`

`FORECAST`

    FORECAST(x,known_y's,known_x's)

#### Description

`FORECAST` function estimates a future value according to existing values using simple linear regression. The estimated future value is a y-value for a given x-value (`x`).

- If `known_x` or `known_y` contains no data entries or different number of data entries, `FORECAST` returns #N/A error.

- If the variance of the `known_x` is zero, `FORECAST` returns #DIV/0 error.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1, and the cells B1, B2, ... B5 23.2, 25.8, 29.9, 33.5, and 42.7. Then

`FORECAST`(7,A1:A5,B1:B5) equals -10.859397661.

#### See also

`INTERCEPT`, `TREND`.

`FREQUENCY`

`FREQUENCY`

    FREQUENCY(data_array,bins_array)

#### Description

`FREQUENCY` function counts how often given values occur within a range of values. The results are given as an array.

`data_array` is a data array for which you want to count the frequencies. `bin_array` is an array containing the intervals into which you want to group the values in data_array. If the `bin_array` is empty, `FREQUENCY` returns the number of data points in `data_array`.

- This function is Excel compatible.

#### Examples

#### See also

`FTEST`

`FTEST`

    FTEST(array1,array2)

#### Description

`FTEST` function returns the two-tailed probability that the variances in the given two data sets are not significantly different.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1, and the cells B1, B2, ... B5 23.2, 25.8, 29.9, 33.5, and 42.7. Then

`FTEST`(A1:A5,B1:B5) equals 0.510815017.

#### See also

`FDIST`, `FINV`.

`GAMMADIST`

`GAMMADIST`

    GAMMADIST(x,alpha,beta,cum)

#### Description

`GAMMADIST` function returns the gamma distribution. If `cum` is TRUE, `GAMMADIST` returns the incomplete gamma function, otherwise it returns the probability mass function.

- If `x` < 0 `GAMMADIST` returns #NUM! error.

- If `alpha` <= 0 or `beta` <= 0, `GAMMADIST` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`GAMMADIST`(1,2,3,0) equals 0.07961459.

#### See also

`GAMMAINV`.

`GAMMAINV`

`GAMMAINV`

    GAMMAINV(p,alpha,beta)

#### Description

`GAMMAINV` function returns the inverse of the cumulative gamma distribution.

- If `p` < 0 or `p` > 1 `GAMMAINV` returns #NUM! error.

- If `alpha` <= 0 or `beta` <= 0 `GAMMAINV` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`GAMMAINV`(0.34,2,4) equals 4.829093908.

#### See also

`GAMMADIST`.

`GAMMALN`

`GAMMALN`

    GAMMALN(x)

#### Description

`GAMMALN` function returns the natural logarithm of the gamma function.

- If `x` is non-number then `GAMMALN` returns #VALUE! error.

- If `x` <= 0 then `GAMMALN` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`GAMMALN`(23) equals 48.471181352.

#### See also

`POISSON`.

`GEOMDIST`

`GEOMDIST`

    GEOMDIST(k,p,cum)

#### Description

`GEOMDIST` returns the probability p(k) of obtaining `k` from a geometric distribution with probability parameter `p`.

- If `k` < 0 `GEOMDIST` returns #NUM! error.

- If `p` < 0 or `p` > 1 `GEOMDIST` returns #NUM! error.

- If `cum` != TRUE and `cum` != FALSE `GEOMDIST` returns #NUM! error.

#### Examples

`GEOMDIST`(2,10.4,TRUE).

#### See also

`RANDGEOM`.

`GEOMEAN`

`GEOMEAN`

    GEOMEAN(b1, b2, ...)

#### Description

`GEOMEAN` returns the geometric mean of the given arguments. This is equal to the Nth root of the product of the terms.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`GEOMEAN`(A1:A5) equals 21.279182482.

#### See also

`AVERAGE`, `HARMEAN`, `MEDIAN`, `MODE`, `TRIMMEAN`.

`GROWTH`

`GROWTH`

    GROWTH(known_y's[,known_x's,new_x's,const])

#### Description

`GROWTH` function applies the ``least squares'' method to fit an exponential curve to your data and predicts the exponential growth by using this curve.

`GROWTH` returns an array having one column and a row for each data point in `new_x`.

- If `known_x`'s is omitted, an array {1, 2, 3, ...} is used.

- If `new_x`'s is omitted, it is assumed to be the same as `known_x`'s.

- If `known_y`'s and `known_x`'s have unequal number of data points, `GROWTH` returns #NUM! error.

- If `const` is FALSE, the line will be forced to go through the origin, i.e., b will be zero. The default is TRUE.

#### Examples

#### See also

`LOGEST`, `GROWTH`, `TREND`.

`HARMEAN`

`HARMEAN`

    HARMEAN(b1, b2, ...)

#### Description

`HARMEAN` returns the harmonic mean of the N data points (that is, N divided by the sum of the inverses of the data points).

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`HARMEAN`(A1:A5) equals 19.529814427.

#### See also

`AVERAGE`, `GEOMEAN`, `MEDIAN`, `MODE`, `TRIMMEAN`.

`HYPGEOMDIST`

`HYPGEOMDIST`

    HYPGEOMDIST(x,n,M,N[,cumulative])

#### Description

`HYPGEOMDIST` function returns the hypergeometric distribution. `x` is the number of successes in the sample, `n` is the number of trials, `M` is the number of successes overall, and `N` is the population size.

If the optional argument `cumulative` is TRUE, the cumulative left tail will be returned.

- If `x`,`n`,`M` or `N` is a non-integer it is truncated.

- If `x`,`n`,`M` or `N` < 0 `HYPGEOMDIST` returns #NUM! error.

- If `x` > `M` or `n` > `N` `HYPGEOMDIST` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`HYPGEOMDIST`(1,2,3,10) equals 0.4666667.

#### See also

`BINOMDIST`, `POISSON`.

`INTERCEPT`

`INTERCEPT`

    INTERCEPT(known_y's,known_x's)

#### Description

`INTERCEPT` function calculates the point where the linear regression line intersects the y-axis.

- If `known_x` or `known_y` contains no data entries or different number of data entries, `INTERCEPT` returns #N/A error.

- If the variance of the `known_x` is zero, `INTERCEPT` returns #DIV/0 error.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1, and the cells B1, B2, ... B5 23.2, 25.8, 29.9, 33.5, and 42.7. Then

`INTERCEPT`(A1:A5,B1:B5) equals -20.785117212.

#### See also

`FORECAST`, `TREND`.

`KURT`

`KURT`

    KURT(n1, n2, ...)

#### Description

`KURT` returns an unbiased estimate of the kurtosis of a data set.

Note, that this is only meaningful if the underlying distribution really has a fourth moment. The kurtosis is offset by three such that a normal distribution will have zero kurtosis.

- Strings and empty cells are simply ignored.

- If fewer than four numbers are given or all of them are equal `KURT` returns #DIV/0! error.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`KURT`(A1:A5) equals 1.234546305.

#### See also

`AVERAGE`, `VAR`, `SKEW`, `KURTP`.

`KURTP`

`KURTP`

    KURTP(n1, n2, ...)

#### Description

`KURTP` returns the population kurtosis of a data set.

- Strings and empty cells are simply ignored.

- If fewer than two numbers are given or all of them are equal `KURTP` returns #DIV/0! error.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`KURTP`(A1:A5) equals -0.691363424.

#### See also

`AVERAGE`, `VARP`, `SKEWP`, `KURT`.

`LANDAU`

`LANDAU`

    LANDAU(x)

#### Description

`LANDAU` returns the probability density p(x) at `x` for the Landau distribution using an approximation method.

#### Examples

`LANDAU`(0.34).

#### See also

`RANDLANDAU`.

`LAPLACE`

`LAPLACE`

    LAPLACE(x,a)

#### Description

`LAPLACE` returns the probability density p(x) at `x` for Laplace distribution with mean `a`.

#### Examples

`LAPLACE`(0.4,1).

#### See also

`RANDLAPLACE`.

`LARGE`

`LARGE`

    LARGE(n1, n2, ..., k)

#### Description

`LARGE` returns the k-th largest value in a data set.

- If data set is empty `LARGE` returns #NUM! error.

- If `k` <= 0 or `k` is greater than the number of data items given `LARGE` returns #NUM! error.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`LARGE`(A1:A5,2) equals 25.9.

`LARGE`(A1:A5,4) equals 17.3.

#### See also

`PERCENTILE`, `PERCENTRANK`, `QUARTILE`, `SMALL`.

`LINEST`

`LINEST`

    LINEST(known_y's[,known_x's[,const[,stat]]])

#### Description

`LINEST` function calculates the ``least squares'' line that best fit to your data in `known_y`'s. `known_x`'s contains the corresponding x's where y=mx+b.

`LINEST` returns an array having two columns and one row. The slope (m) of the regression line y=mx+b is given in the first column and the y-intercept (b) in the second.

If `stat` is TRUE, extra statistical information will be returned. Extra statistical information is written bellow the regression line coefficients in the result array. Extra statistical information consists of four rows of data. In the first row the standard error values for the coefficients m1, (m2, ...), b are represented. The second row contains the square of R and the standard error for the y estimate. The third row contains the F-observed value and the degrees of freedom. The last row contains the regression sum of squares and the residual sum of squares.

- If `known_x`'s is omitted, an array {1, 2, 3, ...} is used.

- If `known_y`'s and `known_x`'s have unequal number of data points, `LINEST` returns #NUM! error.

- If `const` is FALSE, the line will be forced to go through the origin, i.e., b will be zero. The default is TRUE.

- The default of `stat` is FALSE.

#### Examples

#### See also

`LOGEST`, `TREND`.

`LOGEST`

`LOGEST`

    LOGEST(known_y's[,known_x's,const,stat])

#### Description

`LOGEST` function applies the ``least squares'' method to fit an exponential curve of the form

y = b * m{1}^x{1} * m{2}^x{2}... to your data.

If `stat` is TRUE, extra statistical information will be returned. Extra statistical information is written bellow the regression line coefficients in the result array. Extra statistical information consists of four rows of data. In the first row the standard error values for the coefficients m1, (m2, ...), b are represented. The second row contains the square of R and the standard error for the y estimate. The third row contains the F-observed value and the degrees of freedom. The last row contains the regression sum of squares and the residual sum of squares.

- If `known_x`'s is omitted, an array {1, 2, 3, ...} is used. `LOGEST` returns an array { m{n},m{n-1}, ...,m{1},b }.

- If `known_y`'s and `known_x`'s have unequal number of data points, `LOGEST` returns #NUM! error.

- If `const` is FALSE, the line will be forced to go through (0,1),i.e., b will be one. The default is TRUE.

- The default of `stat` is FALSE.

#### Examples

#### See also

`GROWTH`, `TREND`.

`LOGFIT`

`LOGFIT`

    LOGFIT(known_y's,known_x's)

#### Description

`LOGFIT` function applies the ``least squares'' method to fit the logarithmic equation

y = a + b * ln(sign * (x - c)) , sign = +1 or -1

to your data. The graph of the equation is a logarithmic curve moved horizontally by c and possibly mirrored across the y-axis (if sign = -1).

`LOGFIT` returns an array having five columns and one row. `Sign' is given in the first column, `a', `b', and `c' are given in columns 2 to 4. Column 5 holds the sum of squared residuals.

An error is returned when there are less than 3 different x's or y's, or when the shape of the point cloud is too different from a ``logarithmic'' one.

You can use the above formula

= a + b * ln(sign * (x - c))

or rearrange it to

= (exp((y - a) / b)) / sign + c

to compute unknown y's or x's, respectively.

Technically, this is non-linear fitting by trial-and-error. The accuracy of `c' is: width of x-range -> rounded to the next smaller (10^integer), times 0.000001. There might be cases in which the returned fit is not the best possible.

#### Examples

#### See also

`LOGREG`, `LINEST`, `LOGEST`.

`LOGINV`

`LOGINV`

    LOGINV(p,mean,stddev)

#### Description

`LOGINV` function returns the inverse of the lognormal cumulative distribution. `p` is the given probability corresponding to the normal distribution, `mean` is the arithmetic mean of the distribution, and `stddev` is the standard deviation of the distribution.

- If `p` < 0 or `p` > 1 or `stddev` <= 0 `LOGINV` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`LOGINV`(0.5,2,3) equals 7.389056099.

#### See also

`EXP`, `LN`, `LOG`, `LOG10`, `LOGNORMDIST`.

`LOGISTIC`

`LOGISTIC`

    LOGISTIC(x,a)

#### Description

`LOGISTIC` returns the probability density p(x) at `x` for a logistic distribution with scale parameter `a`.

#### Examples

`LOGISTIC`(0.4,1).

#### See also

`RANDLOGISTIC`.

`LOGNORMDIST`

`LOGNORMDIST`

    LOGNORMDIST(x,mean,stddev)

#### Description

`LOGNORMDIST` function returns the lognormal distribution. `x` is the value for which you want the distribution, `mean` is the mean of the distribution, and `stddev` is the standard deviation of the distribution.

- If `stddev` = 0 `LOGNORMDIST` returns #DIV/0! error.

- If `x` <= 0, `mean` < 0 or `stddev` < 0 `LOGNORMDIST` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`LOGNORMDIST`(3,1,2) equals 0.519662338.

#### See also

`NORMDIST`.

`LOGREG`

`LOGREG`

    LOGREG(known_y's[,known_x's[,const[,stat]]])

#### Description

`LOGREG` function transforms your x's to z=ln(x) and applies the ``least squares'' method to fit the linear equation

y = m * z + b

to your y's and z's --- equivalent to fitting the equation

y = m * ln(x) + b

to y's and x's.

If `known_x`'s is omitted, an array {1, 2, 3, ...} is used. `LOGREG` returns an array having two columns and one row. m is given in the first column and b in the second.

If `known_y`'s and `known_x`'s have unequal number of data points, `LOGREG` returns #NUM! error.

If `const` is FALSE, the curve will be forced to go through [1; 0], i.e., b will be zero. The default is TRUE.

If `stat` is TRUE, extra statistical information will be returned which applies to the state AFTER transformation to z. Extra statistical information is written below m and b in the result array. Extra statistical information consists of four rows of data. In the first row the standard error values for the coefficients m, b are represented. The second row contains the square of R and the standard error for the y estimate. The third row contains the F-observed value and the degrees of freedom. The last row contains the regression sum of squares and the residual sum of squares.The default of `stat` is FALSE.

#### Examples

#### See also

`LOGFIT`, `LINEST`, `LOGEST`.

`MAX`

`MAX`

    MAX(b1, b2, ...)

#### Description

`MAX` returns the value of the element of the values passed that has the largest value, with negative numbers considered smaller than positive numbers.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`MAX`(A1:A5) equals 40.1.

#### See also

`MIN`, `ABS`.

`MAXA`

`MAXA`

    MAXA(number1,number2,...)

#### Description

`MAXA` returns the largest value of the given arguments. Numbers, text and logical values are included in the calculation too. If the cell contains text or the argument evaluates to FALSE, it is counted as value zero (0). If the argument evaluates to TRUE, it is counted as one (1). Note that empty cells are not counted.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers and strings 11.4, 17.3, "missing", 25.9, and 40.1. Then

`MAXA`(A1:A5) equals 40.1.

#### See also

`MAX`, `MINA`.

`MEDIAN`

`MEDIAN`

    MEDIAN(n1, n2, ...)

#### Description

`MEDIAN` returns the median of the given data set.

- Strings and empty cells are simply ignored.

- If even numbers are given `MEDIAN` returns the average of the two numbers in the middle.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`MEDIAN`(A1:A5) equals 21.3.

#### See also

`AVERAGE`, `COUNT`, `COUNTA`, `DAVERAGE`, `MODE`, `SSMEDIAN`, `SUM`.

`MIN`

`MIN`

    MIN(b1, b2, ...)

#### Description

`MIN` returns the value of the element of the values passed that has the smallest value, with negative numbers considered smaller than positive numbers.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`MIN`(A1:A5) equals 11.4.

#### See also

`MAX`, `ABS`.

`MINA`

`MINA`

    MINA(number1,number2,...)

#### Description

`MINA` returns the smallest value of the given arguments. Numbers, text and logical values are included in the calculation too. If the cell contains text or the argument evaluates to FALSE, it is counted as value zero (0). If the argument evaluates to TRUE, it is counted as one (1). Note that empty cells are not counted.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers and strings 11.4, 17.3, "missing", 25.9, and 40.1. Then

`MINA`(A1:A5) equals 0.

#### See also

`MIN`, `MAXA`.

`MODE`

`MODE`

    MODE(n1, n2, ...)

#### Description

`MODE` returns the most common number of the data set. If the data set has many most common numbers `MODE` returns the first one of them.

- Strings and empty cells are simply ignored.

- If the data set does not contain any duplicates `MODE` returns #N/A error.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 11.4, 25.9, and 40.1. Then

`MODE`(A1:A5) equals 11.4.

#### See also

`AVERAGE`, `MEDIAN`.

`NEGBINOMDIST`

`NEGBINOMDIST`

    NEGBINOMDIST(f,t,p)

#### Description

`NEGBINOMDIST` function returns the negative binomial distribution. `f` is the number of failures, `t` is the threshold number of successes, and `p` is the probability of a success.

- If `f` or `t` is a non-integer it is truncated.

- If (`f` + `t` -1) <= 0 `NEGBINOMDIST` returns #NUM! error.

- If `p` < 0 or `p` > 1 `NEGBINOMDIST` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`NEGBINOMDIST`(2,5,0.55) equals 0.152872629.

#### See also

`BINOMDIST`, `COMBIN`, `FACT`, `HYPGEOMDIST`, `PERMUT`.

`NORMDIST`

`NORMDIST`

    NORMDIST(x,mean,stddev,cumulative)

#### Description

`NORMDIST` function returns the normal cumulative distribution. `x` is the value for which you want the distribution, `mean` is the mean of the distribution, `stddev` is the standard deviation.

- If `stddev` is 0 `NORMDIST` returns #DIV/0! error.

- This function is Excel compatible.

#### Examples

`NORMDIST`(2,1,2,0) equals 0.176032663.

#### See also

`POISSON`.

`NORMINV`

`NORMINV`

    NORMINV(p,mean,stddev)

#### Description

`NORMINV` function returns the inverse of the normal cumulative distribution. `p` is the given probability corresponding to the normal distribution, `mean` is the arithmetic mean of the distribution, and `stddev` is the standard deviation of the distribution.

- If `p` < 0 or `p` > 1 or `stddev` <= 0 `NORMINV` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`NORMINV`(0.76,2,3) equals 4.118907689.

#### See also

`NORMDIST`, `NORMSDIST`, `NORMSINV`, `STANDARDIZE`, `ZTEST`.

`NORMSDIST`

`NORMSDIST`

    NORMSDIST(x)

#### Description

`NORMSDIST` function returns the standard normal cumulative distribution. `x` is the value for which you want the distribution.

- This function is Excel compatible.

#### Examples

`NORMSDIST`(2) equals 0.977249868.

#### See also

`NORMDIST`.

`NORMSINV`

`NORMSINV`

    NORMSINV(p)

#### Description

`NORMSINV` function returns the inverse of the standard normal cumulative distribution. `p` is the given probability corresponding to the normal distribution.

- If `p` < 0 or `p` > 1 `NORMSINV` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`NORMSINV`(0.2) equals -0.841621234.

#### See also

`NORMDIST`, `NORMINV`, `NORMSDIST`, `STANDARDIZE`, `ZTEST`.

`PARETO`

`PARETO`

    PARETO(x,a,b)

#### Description

`PARETO` returns the probability density p(x) at `x` for a Pareto distribution with exponent `a` and scale `b`.

#### Examples

`PARETO`(0.6,1,2).

#### See also

`RANDPARETO`.

`PEARSON`

`PEARSON`

    PEARSON(array1,array2)

#### Description

`PEARSON` returns the Pearson correlation coefficient of two data sets.

- Strings and empty cells are simply ignored.

- This function is Excel compatible.

#### Examples

#### See also

`INTERCEPT`, `LINEST`, `RSQ`, `SLOPE`, `STEYX`.

`PERCENTILE`

`PERCENTILE`

    PERCENTILE(array,k)

#### Description

`PERCENTILE` function returns the 100*`k`-th percentile of the given data points (that is, a number x such that a fraction `k` of the data points are less than x).

- If `array` is empty, `PERCENTILE` returns #NUM! error.

- If `k` < 0 or `k` > 1, `PERCENTILE` returns #NUM! error.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`PERCENTILE`(A1:A5,0.42) equals 20.02.

#### See also

`QUARTILE`.

`PERCENTRANK`

`PERCENTRANK`

    PERCENTRANK(array,x[,significance])

#### Description

`PERCENTRANK` function returns the rank of a data point in a data set. `array` is the range of numeric values, `x` is the data point which you want to rank, and the optional `significance` specifies the number of significant digits for the returned value, truncating the remainder. If `significance` is omitted, `PERCENTRANK` uses three digits.

- If `array` contains no data points, `PERCENTRANK` returns #NUM! error.

- If `significance` is less than one, `PERCENTRANK` returns #NUM! error.

- If `x` exceeds the largest value or is less than the smallest value in `array`, `PERCENTRANK` returns #NUM! error.

- If `x` does not match any of the values in `array` or `x` matches more than once, `PERCENTRANK` interpolates the returned value.

#### Examples

#### See also

`LARGE`, `MAX`, `MEDIAN`, `MIN`, `PERCENTILE`, `QUARTILE`, `SMALL`.

`PERMUT`

`PERMUT`

    PERMUT(n,k)

#### Description

`PERMUT` function returns the number of permutations. `n` is the number of objects, `k` is the number of objects in each permutation.

- If `n` = 0 `PERMUT` returns #NUM! error.

- If `n` < `k` `PERMUT` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`PERMUT`(7,3) equals 210.

#### See also

`COMBIN`.

`POISSON`

`POISSON`

    POISSON(x,mean,cumulative)

#### Description

`POISSON` function returns the Poisson distribution. `x` is the number of events, `mean` is the expected numeric value `cumulative` describes whether to return the sum of the Poisson function from 0 to `x`.

- If `x` is a non-integer it is truncated.

- If `x` < 0 `POISSON` returns #NUM! error.

- If `mean` <= 0 `POISSON` returns the #NUM! error.

- This function is Excel compatible.

#### Examples

`POISSON`(3,6,0) equals 0.089235078.

#### See also

`NORMDIST`, `WEIBULL`.

`PROB`

`PROB`

    PROB(x_range,prob_range,lower_limit[,upper_limit])

#### Description

`PROB` function returns the probability that values in a range or an array are between two limits. If `upper_limit` is not given, `PROB` returns the probability that values in `x_range` are equal to `lower_limit`.

- If the sum of the probabilities in `prob_range` is not equal to 1 `PROB` returns #NUM! error.

- If any value in `prob_range` is <=0 or > 1, `PROB` returns #NUM! error.

- If `x_range` and `prob_range` contain a different number of data entries, `PROB` returns #N/A error.

- This function is Excel compatible.

#### Examples

#### See also

`BINOMDIST`, `CRITBINOM`.

`QUARTILE`

`QUARTILE`

    QUARTILE(array,quart)

#### Description

`QUARTILE` function returns the quartile of the given data points.

If `quart` is equal to: `QUARTILE` returns:

0 the smallest value of `array`.

1 the first quartile

2 the second quartile

3 the third quartile

4 the largest value of `array`.

- If `array` is empty, `QUARTILE` returns #NUM! error.

- If `quart` < 0 or `quart` > 4, `QUARTILE` returns #NUM! error.

- If `quart` is not an integer, it is truncated.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`QUARTILE`(A1:A5,1) equals 17.3.

#### See also

`LARGE`, `MAX`, `MEDIAN`, `MIN`, `PERCENTILE`, `SMALL`.

`RANK`

`RANK`

    RANK(x,ref[,order])

#### Description

`RANK` returns the rank of a number in a list of numbers. `x` is the number whose rank you want to find, `ref` is the list of numbers, and `order` specifies how to rank numbers. If `order` is 0, numbers are ranked in descending order, otherwise numbers are ranked in ascending order.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`RANK`(17.3,A1:A5) equals 4.

#### See also

`PERCENTRANK`.

`RAYLEIGH`

`RAYLEIGH`

    RAYLEIGH(x,sigma)

#### Description

`RAYLEIGH` returns the probability density p(x) at `x` for a Rayleigh distribution with scale parameter `sigma`.

#### Examples

`RAYLEIGH`(0.4,1).

#### See also

`RANDRAYLEIGH`.

`RAYLEIGHTAIL`

`RAYLEIGHTAIL`

    RAYLEIGHTAIL(x,a,sigma)

#### Description

`RAYLEIGHTAIL` returns the probability density p(x) at `x` for a Rayleigh tail distribution with scale parameter `sigma` and lower limit `a`.

#### Examples

`RAYLEIGHTAIL`(0.6,0.3,1).

#### See also

`RANDRAYLEIGHTAIL`.

`RSQ`

`RSQ`

    RSQ(array1,array2)

#### Description

`RSQ` returns the square of the Pearson correlation coefficient of two data sets.

- Strings and empty cells are simply ignored.

- This function is Excel compatible.

#### Examples

#### See also

`CORREL`, `COVAR`, `INTERCEPT`, `LINEST`, `LOGEST`, `PEARSON`, `SLOPE`, `STEYX`, `TREND`.

`SKEW`

`SKEW`

    SKEW(n1, n2, ...)

#### Description

`SKEW` returns an unbiased estimate for skewness of a distribution.

Note, that this is only meaningful if the underlying distribution really has a third moment. The skewness of a symmetric (e.g., normal) distribution is zero.

- Strings and empty cells are simply ignored.

- If less than three numbers are given, `SKEW` returns #DIV/0! error.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`SKEW`(A1:A5) equals 0.976798268.

#### See also

`AVERAGE`, `VAR`, `SKEWP`, `KURT`.

`SKEWP`

`SKEWP`

    SKEWP(n1, n2, ...)

#### Description

`SKEWP` returns the population skewness of a data set.

- Strings and empty cells are simply ignored.

- If less than two numbers are given, `SKEWP` returns #DIV/0! error.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`SKEWP`(A1:A5) equals 0.655256198.

#### See also

`AVERAGE`, `VARP`, `SKEW`, `KURTP`.

`SLOPE`

`SLOPE`

    SLOPE(known_y's,known_x's)

#### Description

`SLOPE` returns the slope of the linear regression line.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1, and the cells B1, B2, ... B5 23.2, 25.8, 29.9, 33.5, and 42.7. Then

`SLOPE`(A1:A5,B1:B5) equals 1.417959936.

#### See also

`STDEV`, `STDEVPA`.

`SMALL`

`SMALL`

    SMALL(n1, n2, ..., k)

#### Description

`SMALL` returns the k-th smallest value in a data set.

- If data set is empty `SMALL` returns #NUM! error.

- If `k` <= 0 or `k` is greater than the number of data items given `SMALL` returns #NUM! error.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`SMALL`(A1:A5,2) equals 17.3.

`SMALL`(A1:A5,4) equals 25.9.

#### See also

`PERCENTILE`, `PERCENTRANK`, `QUARTILE`, `LARGE`.

`SSMEDIAN`

`SSMEDIAN`

    SSMEDIAN(array[,interval)]

#### Description

The `SSMEDIAN` function returns the median for grouped data as commonly determined in the social sciences. The data points given in `array` are assumed to be the result of grouping data into intervals of length `interval`

- If `interval` is not given, `SSMEDIAN` uses 1.

- If `array` is empty, `SSMEDIAN` returns #NUM! error.

- If `interval` <= 0, `SSMEDIAN` returns #NUM! error.

- `SSMEDIAN` does not check whether the data points are at least `interval` apart.

#### Examples

Let us assume that the cells A1, A2, A3 contain numbers 7, 8, 8. Then

`SSMEDIAN`(A1:A3, 1) equals 7.75.

#### See also

`MEDIAN`.

`STANDARDIZE`

`STANDARDIZE`

    STANDARDIZE(x,mean,stddev)

#### Description

`STANDARDIZE` function returns a normalized value. `x` is the number to be normalized, `mean` is the mean of the distribution, `stddev` is the standard deviation of the distribution.

- If `stddev` is 0 `STANDARDIZE` returns #DIV/0! error.

- This function is Excel compatible.

#### Examples

`STANDARDIZE`(3,2,4) equals 0.25.

#### See also

`AVERAGE`.

`STDEV`

`STDEV`

    STDEV(b1, b2, ...)

#### Description

`STDEV` returns the sample standard deviation of the given sample.

To obtain the population standard deviation of a whole population use STDEVP.

`STDEV` is also known as the N-1-standard deviation.

Under reasonable conditions, it is the maximum-likelihood estimator for the true population standard deviation.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`STDEV`(A1:A5) equals 10.84619749.

#### See also

`AVERAGE`, `DSTDEV`, `DSTDEVP`, `STDEVA`, `STDEVPA`, `VAR`.

`STDEVA`

`STDEVA`

    STDEVA(number1,number2,...)

#### Description

`STDEVA` returns the sample standard deviation of the given sample.

To obtain the population standard deviation of a whole population use STDEVPA.

`STDEVA` is also known as the N-1-standard deviation.

Under reasonable conditions, it is the maximum-likelihood estimator for the true population standard deviation.

Numbers, text and logical values are included in the calculation too. If the cell contains text or the argument evaluates to FALSE, it is counted as value zero (0). If the argument evaluates to TRUE, it is counted as one (1). Note that empty cells are not counted.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers and strings 11.4, 17.3, "missing", 25.9, and 40.1. Then

`STDEVA`(A1:A5) equals 15.119953704.

#### See also

`STDEV`, `STDEVPA`.

`STDEVP`

`STDEVP`

    STDEVP(b1, b2, ...)

#### Description

`STDEVP` returns the population standard deviation of the given population.

This is also known as the N-standard deviation

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`STDEVP`(A1:A5) equals 9.701133954.

#### See also

`STDEV`, `STDEVA`, `STDEVPA`.

`STDEVPA`

`STDEVPA`

    STDEVPA(number1,number2,...)

#### Description

`STDEVPA` returns the population standard deviation of an entire population.

This is also known as the N-standard deviation

Numbers, text and logical values are included in the calculation too. If the cell contains text or the argument evaluates to FALSE, it is counted as value zero (0). If the argument evaluates to TRUE, it is counted as one (1). Note that empty cells are not counted.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers and strings 11.4, 17.3, "missing", 25.9, and 40.1. Then

`STDEVPA`(A1:A5) equals 13.523697719.

#### See also

`STDEVA`, `STDEVP`.

`STEYX`

`STEYX`

    STEYX(known_y's,known_x's)

#### Description

`STEYX` function returns the standard error of the predicted y-value for each x in the regression.

- If `known_y`'s and `known_x`'s are empty or have a different number of arguments then `STEYX` returns #N/A error.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1, and the cells B1, B2, ... B5 23.2, 25.8, 29.9, 33.5, and 42.7. Then

`STEYX`(A1:A5,B1:B5) equals 1.101509979.

#### See also

`PEARSON`, `RSQ`, `SLOPE`.

`SUBTOTAL`

`SUBTOTAL`

    SUBTOTAL(function_nbr,ref1,ref2,...)

#### Description

`SUBTOTAL` function returns a subtotal of given list of arguments. `function_nbr` is the number that specifies which function to use in calculating the subtotal.

The following functions are available:

1 AVERAGE

2 COUNT

3 COUNTA

4 MAX

5 MIN

6 PRODUCT

7 STDEV

8 STDEVP

9 SUM

10 VAR

11 VARP

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 23, 27, 28, 33, and 39. Then

`SUBTOTAL`(1,A1:A5) equals 30.

`SUBTOTAL`(6,A1:A5) equals 22378356.

`SUBTOTAL`(7,A1:A5) equals 6.164414003.

`SUBTOTAL`(9,A1:A5) equals 150.

`SUBTOTAL`(11,A1:A5) equals 30.4.

#### See also

`COUNT`, `SUM`.

`TDIST`

`TDIST`

    TDIST(x,dof,tails)

#### Description

`TDIST` function returns the Student's t-distribution. `dof` is the degree of freedom and `tails` is 1 or 2 depending on whether you want one-tailed or two-tailed distribution.

`tails` = 1 returns the size of the right tail.

- If `dof` < 1 `TDIST` returns #NUM! error.

- If `tails` is neither 1 or 2 `TDIST` returns #NUM! error.

- This function is Excel compatible for non-negative `x`.

#### Examples

`TDIST`(2,5,1) equals 0.050969739.

`TDIST`(-2,5,1) equals 0.949030261.

`TDIST`(0,5,2) equals 1.

#### See also

`TINV`, `TTEST`.

`TINV`

`TINV`

    TINV(p,dof)

#### Description

`TINV` function returns the inverse of the two-tailed Student's t-distribution.

- If `p` < 0 or `p` > 1 or `dof` < 1 `TINV` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`TINV`(0.4,32) equals 0.852998454.

#### See also

`TDIST`, `TTEST`.

`TREND`

`TREND`

    TREND(known_y's[,known_x's[,new_x's[,const]]])

#### Description

`TREND` function estimates future values of a given data set using the ``least squares'' line that best fit to your data. `known_y`'s is the y-values where y=mx+b and `known_x`'s contains the corresponding x-values. `new_x`'s contains the x-values for which you want to estimate the y-values. If `const` is FALSE, the line will be forced to go through the origin, i.e., b will be zero.

- If `known_x`'s is omitted, an array {1, 2, 3, ...} is used.

- If `new_x`'s is omitted, it is assumed to be the same as `known_x`'s.

- If `const` is omitted, it is assumed to be TRUE.

- If `known_y`'s and `known_x`'s have unequal number of data points, `TREND` returns #NUM! error.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1, and the cells B1, B2, ... B5 23.2, 25.8, 29.9, 33.5, and 42.7. Then

`TREND`(A1:A5,B1:B5) equals {12.1, 15.7, 21.6, 26.7, 39.7}.

#### See also

`LINEST`.

`TRIMMEAN`

`TRIMMEAN`

    TRIMMEAN(ref,fraction)

#### Description

`TRIMMEAN` returns the mean of the interior of a data set. `ref` is the list of numbers whose mean you want to calculate and `fraction` is the fraction of the data set excluded from the mean. For example, if `fraction`=0.2 and the data set contains 40 numbers, 8 numbers are trimmed from the data set (40 x 0.2), 4 from the top and 4 from the bottom of the set.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`TRIMMEAN`(A1:A5,0.2) equals 23.2.

#### See also

`AVERAGE`, `GEOMEAN`, `HARMEAN`, `MEDIAN`, `MODE`.

`TTEST`

`TTEST`

    TTEST(array1,array2,tails,type)

#### Description

`TTEST` function returns the probability of a Student's t-Test.

`array1` is the first data set and `array2` is the second data set. If `tails` is one, `TTEST` uses the one-tailed distribution and if `tails` is two, `TTEST` uses the two-tailed distribution. `type` determines the kind of the test:

1 Paired test

2 Two-sample equal variance

3 Two-sample unequal variance

- If the data sets contain a different number of data points and the test is paired (`type` one), `TTEST` returns the #N/A error.

- `tails` and `type` are truncated to integers.

- If `tails` is not one or two, `TTEST` returns #NUM! error.

- If `type` is any other than one, two, or three, `TTEST` returns #NUM! error.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1, and the cells B1, B2, ... B5 23.2, 25.8, 29.9, 33.5, and 42.7. Then

`TTEST`(A1:A5,B1:B5,1,1) equals 0.003127619.

`TTEST`(A1:A5,B1:B5,2,1) equals 0.006255239.

`TTEST`(A1:A5,B1:B5,1,2) equals 0.111804322.

`TTEST`(A1:A5,B1:B5,1,3) equals 0.113821797.

#### See also

`FDIST`, `FINV`.

`VAR`

`VAR`

    VAR(b1, b2, ...)

#### Description

`VAR` calculates sample variance of the given sample. To get the true variance of a complete population use VARP.

`VAR` is also known as the N-1-variance. Under reasonable conditions, it is the maximum-likelihood estimator for the true variance.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`VAR`(A1:A5) equals 117.64.

#### See also

`VARP`, `STDEV`.

`VARA`

`VARA`

    VARA(number1,number2,...)

#### Description

`VARA` calculates sample variance of the given sample.

To get the true variance of a complete population use VARPA.

`VARA` is also known as the N-1-variance.

Under reasonable conditions, it is the maximum-likelihood estimator for the true variance.

Numbers, text and logical values are included in the calculation too. If the cell contains text or the argument evaluates to FALSE, it is counted as value zero (0). If the argument evaluates to TRUE, it is counted as one (1). Note that empty cells are not counted.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers and strings 11.4, 17.3, "missing", 25.9, and 40.1. Then

`VARA`(A1:A5) equals 228.613.

#### See also

`VAR`, `VARPA`.

`VARP`

`VARP`

    VARP(b1, b2, ...)

#### Description

`VARP` calculates the variance of an entire population.

`VARP` is also known as the N-variance.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`VARP`(A1:A5) equals 94.112.

#### See also

`AVERAGE`, `DVAR`, `DVARP`, `STDEV`, `VAR`.

`VARPA`

`VARPA`

    VARPA(number1,number2,...)

#### Description

`VARPA` calculates the variance of an entire population.

`VARPA` is also known as the N-variance.

Numbers, text and logical values are included in the calculation too. If the cell contains text or the argument evaluates to FALSE, it is counted as value zero (0). If the argument evaluates to TRUE, it is counted as one (1). Note that empty cells are not counted.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers and strings 11.4, 17.3, "missing", 25.9, and 40.1. Then

`VARPA`(A1:A5) equals 182.8904.

#### See also

`VARA`, `VARP`.

`WEIBULL`

`WEIBULL`

    WEIBULL(x,alpha,beta,cumulative)

#### Description

`WEIBULL` function returns the Weibull distribution. If the `cumulative` boolean is true it will return:

1 - exp (-(`x`/`beta`)^`alpha`),

otherwise it will return

(`alpha`/`beta`^`alpha`) * `x`^(`alpha`-1) * exp(-(`x`/`beta`^`alpha`)).

- If `x` < 0 `WEIBULL` returns #NUM! error.

- If `alpha` <= 0 or `beta` <= 0 `WEIBULL` returns #NUM! error.

- This function is Excel compatible.

#### Examples

`WEIBULL`(3,2,4,0) equals 0.213668559.

#### See also

`POISSON`.

`ZTEST`

`ZTEST`

    ZTEST(ref,x)

#### Description

`ZTEST` returns the two-tailed probability of a z-test.

`ref` is the data set and `x` is the value to be tested.

- If `ref` contains less than two data items `ZTEST` returns #DIV/0! error.

- This function is Excel compatible.

#### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11.4, 17.3, 21.3, 25.9, and 40.1. Then

`ZTEST`(A1:A5,20) equals 0.254717826.

#### See also

`CONFIDENCE`, `NORMDIST`, `NORMINV`, `NORMSDIST`, `NORMSINV`, `STANDARDIZE`.

## String

`CHAR`

`CHAR`

    CHAR(x)

#### Description

`CHAR` returns the ASCII character represented by the number `x`.

#### Examples

`CHAR`(65) equals A.

#### See also

`CODE`.

`CLEAN`

`CLEAN`

    CLEAN(string)

#### Description

`CLEAN` removes any non-printable characters from `string`.

- This function is Excel compatible.

#### Examples

`CLEAN`("one"\&char(7)) equals "one".

#### See also

`CODE`

`CODE`

    CODE(char)

#### Description

`CODE` returns the ASCII number for the character `char`.

- This function is Excel compatible.

#### Examples

`CODE`("A") equals 65.

#### See also

`CHAR`.

`CONCATENATE`

`CONCATENATE`

    CONCATENATE(string1[,string2...])

#### Description

`CONCATENATE` returns the string obtained by concatenation of the given strings.

- This function is Excel compatible.

#### Examples

`CONCATENATE`("aa","bb") equals "aabb".

#### See also

`LEFT`, `MID`, `RIGHT`.

`DOLLAR`

`DOLLAR`

    DOLLAR(num[,decimals])

#### Description

`DOLLAR` returns `num` formatted as currency.

- This function is Excel compatible.

#### Examples

`DOLLAR`(12345) equals "$12,345.00".

#### See also

`FIXED`, `TEXT`, `VALUE`.

`EXACT`

`EXACT`

    EXACT(string1, string2)

#### Description

`EXACT` returns true if `string1` is exactly equal to `string2` (this routine is case sensitive).

- This function is Excel compatible.

#### Examples

`EXACT`("key","key") equals TRUE.

`EXACT`("key","Key") equals FALSE.

#### See also

`LEN`, `SEARCH`, `DELTA`.

`FIND`

`FIND`

    FIND(string1,string2[,start])

#### Description

`FIND` returns position of `string1` in `string2` (case-sensitive), searching only from character `start` onwards (assuming 1 if omitted).

- This function is Excel compatible.

#### Examples

`FIND`("ac","Jack") equals 2.

#### See also

`EXACT`, `LEN`, `MID`, `SEARCH`.

`FIXED`

`FIXED`

    FIXED(num,[decimals, no_commas])

#### Description

`FIXED` returns `num` as a formatted string with `decimals` numbers after the decimal point, omitting commas if requested by `no_commas`.

- This function is Excel compatible.

#### Examples

`FIXED`(1234.567,2) equals "1,234.57".

#### See also

`TEXT`, `VALUE`, `DOLLAR`.

`LEFT`

`LEFT`

    LEFT(text[,num_chars])

#### Description

`LEFT` returns the leftmost `num_chars` characters or the left character if `num_chars` is not specified.

- This function is Excel compatible.

#### Examples

`LEFT`("Directory",3) equals "Dir".

#### See also

`MID`, `RIGHT`.

`LEN`

`LEN`

    LEN(string)

#### Description

`LEN` returns the length in characters of the string `string`.

- This function is Excel compatible.

#### Examples

`LEN`("Helsinki") equals 8.

#### See also

`CHAR`, `CODE`.

`LENB`

`LENB`

    LENB(string)

#### Description

`LENB` returns the length in bytes of the string `string`.

- This function is Excel compatible.

#### Examples

`LENB`("Helsinki") equals 8.

#### See also

`CHAR`, `CODE`, `LEN`.

`LOWER`

`LOWER`

    LOWER(text)

#### Description

`LOWER` returns a lower-case version of the string in `text`.

- This function is Excel compatible.

#### Examples

`LOWER`("J. F. Kennedy") equals "j. f. kennedy".

#### See also

`UPPER`.

`MID`

`MID`

    MID(string, position, length)

#### Description

`MID` returns a substring from `string` starting at `position` for `length` characters.

- This function is Excel compatible.

#### Examples

`MID`("testing",2,3) equals "est".

#### See also

`LEFT`, `RIGHT`.

`PROPER`

`PROPER`

    PROPER(string)

#### Description

`PROPER` returns `string` with initial of each word capitalised.

- This function is Excel compatible.

#### Examples

`PROPER`("j. f. kennedy") equals "J. F. Kennedy".

#### See also

`LOWER`, `UPPER`.

`REPLACE`

`REPLACE`

    REPLACE(old,start,num,new)

#### Description

`REPLACE` returns `old` with `new` replacing `num` characters from `start`.

- This function is Excel compatible.

#### Examples

`REPLACE`("testing",2,3,"*****") equals "t*****ing".

#### See also

`MID`, `SEARCH`, `SUBSTITUTE`, `TRIM`.

`REPT`

`REPT`

    REPT(string,num)

#### Description

`REPT` returns `num` repetitions of `string`.

- This function is Excel compatible.

#### Examples

`REPT`(".",3) equals "...".

#### See also

`CONCATENATE`.

`RIGHT`

`RIGHT`

    RIGHT(text[,num_chars])

#### Description

`RIGHT` returns the rightmost `num_chars` characters or the right character if `num_chars` is not specified.

- This function is Excel compatible.

#### Examples

`RIGHT`("end") equals "d".

`RIGHT`("end",2) equals "nd".

#### See also

`MID`, `LEFT`.

`SEARCH`

`SEARCH`

    SEARCH(search_string,text[,start_num])

#### Description

`SEARCH` returns the location of the `search_` string within `text`. The search starts with the `start_num` character of text `text`. If `start_num` is omitted, it is assumed to be one. The search is not case sensitive.

`search_string` can contain wildcard characters (*) and question marks (?). A question mark matches any character and a wildcard matches any string including the empty string. If you want the actual wildcard or question mark to be found, use tilde (~) before the character.

- If `search_string` is not found, `SEARCH` returns #VALUE! error.

- If `start_num` is less than one or it is greater than the length of `text`, `SEARCH` returns #VALUE! error.

- This function is Excel compatible.

#### Examples

`SEARCH`("c","Cancel") equals 1.

`SEARCH`("c","Cancel",2) equals 4.

#### See also

`FIND`.

`SUBSTITUTE`

`SUBSTITUTE`

    SUBSTITUTE(text, old, new [,num])

#### Description

`SUBSTITUTE` replaces `old` with `new` in `text`. Substitutions are only applied to instance `num` of `old` in `text`, otherwise every one is changed.

- This function is Excel compatible.

#### Examples

`SUBSTITUTE`("testing","test","wait") equals "waiting".

#### See also

`REPLACE`, `TRIM`.

`T`

`T`

    T(value)

#### Description

`T` returns `value` if and only if it is text, otherwise a blank string.

- This function is Excel compatible.

#### Examples

`T`("text") equals "text".

`T`(64) returns an empty cell.

#### See also

`CELL`, `N`, `VALUE`.

`TEXT`

`TEXT`

    TEXT(value,format_text)

#### Description

`TEXT` returns `value` as a string with the specified format.

- This function is Excel compatible.

#### Examples

`TEXT`(3.223,"$0.00") equals "$3.22".

`TEXT`(date(1999,4,15),"mmmm, dd, yy") equals "April, 15, 99".

#### See also

`DOLLAR`, `FIXED`, `VALUE`.

`TRIM`

`TRIM`

    TRIM(text)

#### Description

`TRIM` returns `text` with only single spaces between words.

- This function is Excel compatible.

#### Examples

`TRIM`(" a bbb cc") equals "a bbb cc".

#### See also

`CLEAN`, `MID`, `REPLACE`, `SUBSTITUTE`.

`UNICHAR`

`UNICHAR`

    UNICHAR(x)

#### Description

`UNICHAR` returns the Unicode character represented by the number `x`.

#### Examples

`UNICHAR`(65) equals A.

`UNICHAR`(960) equals a small Greek pi.

#### See also

`CHAR`, `UNICODE`, `CODE`.

`UNICODE`

`UNICODE`

    UNICODE(char)

#### Description

`UNICODE` returns the Unicode number for the character `char`.

#### Examples

`UNICODE`("A") equals 65.

#### See also

`UNICHAR`, `CODE`, `CHAR`.

`UPPER`

`UPPER`

    UPPER(text)

#### Description

`UPPER` returns a upper-case version of the string in `text`.

- This function is Excel compatible.

#### Examples

`UPPER`("cancelled") equals "CANCELLED".

#### See also

`LOWER`.

`VALUE`

`VALUE`

    VALUE(text)

#### Description

`VALUE` returns numeric value of `text`.

- This function is Excel compatible.

#### Examples

`VALUE`("$1,000") equals 1000.

#### See also

`DOLLAR`, `FIXED`, `TEXT`.