# Function Reference

## abs

abs(x)

### Description

Returns the absolute numerical value of x.

### Examples

abs(-3.14) returns 3.14.

fabs

## acos

acos(x)

### Description

Returns the inverse cosine of x.

cos

## 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. Excel compatible.

### Examples

ACOSH(2) equals 1.31696.

ACOSH(5.3) equals 2.35183.

acos asinh degrees radians

### Synopsis

address(row_num, col_num[, abs_num, a1, text])

### Description

Address returns a cell address as text for specified row and column numbers.

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 error.

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 row_num or col_num is less than one, address returns error.

## and

and(b1, b2, ...)

### Description

And implements the logical and function: the result is TRUE if all of the expression evaluates 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 error is returned. Excel compatible. The name of the function is @and, since and is used by Scheme.

### 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.

or not

## ash

ash(value, bits)

### Description

Arithmetic shift of value a given number of bits to the left (positive) or right (negative).

### Examples

ash(1, 2) returns 4.

## asin

asin(x)

### Description

Returns the inverse sin of x.

sin

## asinh

asinh(x)

### Description

ASINH function calculates the inverse hyperbolic sine of x; that is the value whose hyperbolic sine is x. Excel compatible.

### Examples

ASINH(0.5) equals 0.481212.

ASINH(1.0) equals 0.881374.

asin acosh sin cos degrees radians

## atan

atan(x)

### Description

Returns the inverse tangent of x.

tan

## atan2

atan2(x, y)

### Description

Returns the inverse tangent of x/y.

tan atan atan_2

## atan_2

atan_2(x, y)

### Description

Returns the inverse tangent of x/y. This is the same function as atan2, but avoids being interpreted as an A1 style reference.

tan atan

## 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.

atan tan sin cos degrees radians

## avedev

### Synopsis

avedev(n1, n2, ...)

### Description

Avedev returns the average of the absolute deviations of a data set from their mean. 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.

stdev

## average

### Synopsis

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.

sum count

## averagea

### Synopsis

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.

average

## base64decode

base64decode(x)

### Description

Given a string X in base64 representation returns a string with bytes computed using the base64 decoding algorithm. See rfc1521.txt.

base64encode

## base64encode

base64encode(x)

### Description

Returns a string computed using the base64 encoding algorithm.

base64decode

## besseli

### Synopsis

besseli(x, order)

### Description

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

If x or order are not numeric an error is returned. If order < 0 a error is returned. Excel compatible.

### Examples

besseli(0.7,3) equals 0.007367374.

besselj besselk bessely

## besselj

### Synopsis

besselj(x, order)

### Description

Besselj returns the bessel function with x is where the function is evaluated. order is the order of the bessel function, if non-integer it is truncated.

If x or order are not numeric an error is returned. If order < 0 a error is returned. Excel compatible.

### Examples

besselj(0.89,3) equals 0.013974004.

besselj besselk bessely

## besselk

### Synopsis

besselk(x, order)

### Description

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

If x or order are not numeric an error is returned. If order < 0 a error is returned. Excel compatible.

### Examples

besselk(3,9) equals 397.95880.

besseli besselj bessely

## bessely

### Synopsis

bessely(x, order)

### Description

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

If x or order are not numeric an error is returned. If order < 0 a error is returned. Excel compatible.

### Examples

bessely(4,2) equals 0.215903595.

besseli besselj besselk

### Synopsis

betadist(x, alpha, beta[, a, b])

### Description

Betadist 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 error. If alpha <= 0 or beta <= 0, betadist returns error. If a >= b betadist returns error. Excel compatible.

betainv

## betainv

### Synopsis

betainv(p, alpha, beta[, a, b])

### Description

Betainv returns the inverse of cumulative beta distribution. a is the optional lower bound of x and b is the optinal 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 error. If alpha <= 0 or beta <= 0, betainv returns error. If a >= b, betainv returns error. Excel compatible.

### Examples

betainv(0.45,1.6,1) equals 0.607096629.

## bin2dec

bin2dec(x)

### Description

Bin2dec converts a binary number in string or number to its decimal equivalent. Excel compatible.

### Examples

bin2dec(101) equals 5.

dec2bin bin2oct bin2hex

## bin2hex

### Synopsis

bin2hex(number[, places])

### Description

Bin2hex 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 error is returned. This function is Excel compatible.

### Examples

bin2hex(100111) equals 27.

hex2bin bin2oct bin2dec

## bin2oct

### Synopsis

bin2oct(number[, places])

### Description

Bin2oct 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 error is returned. This function is Excel compatible.

### Examples

bin2oct(110111) equals 67.

oct2bin bin2dec bin2hex

## binomdist

### Synopsis

binomdist(n, trials, p, cumulative)

### Description

Binomdist 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 thebinomial function from 0 to n.

If n or trials are non-integer they are truncated. If n < 0 or trials < 0 binomdist returns error. If n > trials binomdist returns error. If p < 0 or p > 1 binomdist returns error. Excel compatible.

### Examples

binomdist(3,5,0.8,0) equals 0.2048.

poisson

## cbrt

cbrt(x)

### Description

The cbrt() function returns the cube root of x. This function cannot fail; every representable real value has a representable real cube root.

sqrt pow

## cc_solv

cc_solv(a, b, n)

### Description

Solve a general linear system A*x = b.

int solv(double a[],double b[],int n)

a = array containing system matrix A in row order (altered to L-U factored form by computation)

b = array containing system vector b at entry and solution vector x at exit

n = dimension of system

## ceil

ceil(x)

### Description

CEIL function rounds x up to the next nearest integer.

Excel compatible.

### Examples

CEIL(0.4) equals 1.

CEIL(-1.1) equals -1.

CEIL(-2.9) equals -2.

abs floor int

## ceiling

### Synopsis

ceiling(x, significance)

### Description

Ceiling rounds x up to the nearest multiple of significance.

If x or significance is non-numeric ceiling returns error. If x and significance have different signs ceiling returns error. Excel compatible.

### Examples

ceiling(2.43,1) equals 3.

ceiling(123.123,3) equals 126.

ceil

## char

char(x)

### Description

Char returns the ASCII character represented by the number x.

### Examples

char(65) equals A.

code

## chidist

chidist(x, dof)

### Description

Chidist 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 error. Excel compatible.

### Examples

chidist(5.3,2) equals 0.070651213.

chiinv chitest

## chiinv

chiinv(p, dof)

### Description

Chiinv returns the inverse of the one-tailed probability of the chi-squared distribution.

If p < 0 or p > 1 or dof < 1, chiinv returns error. This function is Excel compatible.

### Examples

chiinv(0.98,7) equals 1.564293004.

chidist chitest

## choose

### Synopsis

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: returns error.

if

## code

code(char)

### Description

Code returns the ASCII number for the character char.

### Examples

code("A") equals 65.

char

## columns

columns(range)

### Description

The columns function returns the number of columns in area or array reference.

If reference is neither an array nor a range returns error.

column row rows

## combin

combin(n, k)

### Description

Combin computes the number of combinations.

Performing this function on a non-integer or a negative number returns an error. Also if n is less than k returns an error. This function is Excel compatible.

### Examples

combin(8,6) equals 28.

combin(6,2) equals 15.

## complex

### Synopsis

complex(real, im[, suffix])

### Description

Complex returns a complex number of the form x + yi. real is the real and im is the imaginary coefficient of the complex number. suffix is the suffix for the imaginary coefficient. If it is omitted, complex uses 'i' by default.

If suffix is neither 'i' nor 'j', complex returns error. This function is Excel compatible.

### Examples

complex(1,-1) equals 1-i.

## concatenate

### Synopsis

concatenate(string1[, string2...])

### Description

Concatenate returns up appended strings.

### Examples

concatenate("aa","bb") equals "aabb".

left mid right

## confidence

### Synopsis

confidence(x, stddev, size)

### Description

Confidence returns the confidence interval for a mean. x is the significance level, stddev is the standard deviation, and size is the size of the sample.

If size is non-integer it is truncated. If size < 0, confidence returns error. If size is 0, confidence returns error. Excel compatible.

### Examples

confidence(0.05,1,33) equals 0.341185936.

average

## convert

### Synopsis

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:

'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' dekao 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

If from_unit and to_unit are different types, CONVERT returns error. 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.

## cos

cos(x)

### Description

Returns the cosine where x is in units of radians.

sin

## 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. Excel compatible.

### Examples

COSH(0.5) equals 1.127626.

COSH(1) equals 1.543081.

cos sin sinh tan tanh radians degrees exp

## count

### Synopsis

count(b1, b2, ...)

### Description

Count returns the total number of integer or floating point arguments passed. Empty cells do not count. Strings and labels do not count. Complex numbers do not count. 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.

average

## counta

### Synopsis

counta(b1, b2, ...)

### Description

Counta returns the number of arguments passed not including empty cells. 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.

average count dcount dcounta product sum

## countblank

### Synopsis

countblank(range)

### Description

Countblank returns the number of blank cells in a range. This function is Excel compatible.

count

## countif

### Synopsis

countif(range, criteria)

### Description

Countif counts the number of cells in the given range that meet the given criteria. 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.

count sumif

## critbinom

### Synopsis

critbinom(trials,p,alpha)

### Description

Critbinom returns the smallest value for which thecumulative 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 error. If p < 0 or p > 1, critbinom returns error. If alpha < 0 or alpha > 1, critbinom returns error. This function is Excel compatible.

### Examples

critbinom(10,0.5,0.75) equals 6.

binomdist

## crypt

crypt(key, salt)

### Description

A form of string hash.

## currency_rate

### Synopsis

currency_rate(from, to)

### Description

Fetches currency exchange rates from Yahoo over the Internet.

### Examples

currency_rate("SEK", "FRF") returns the value in French francs of one Swedish krona.

stock_price euro

## datevalue

### Synopsis

datevalue(date_str)

### Description

Datevalue returns the serial number of the date. date_str is the string that contains the date. For example, datevalue("1/1/1999") equals 36160.

date

## daverage

### Synopsis

daverage(database,field,criteria)

### Description

Daverage 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, i.e. 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 criterias are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifing a value, e.g. ``3'' or ``John''. Each row in criteria specifies a separate condition, i.e. if a row in database matches with one of the rows in criteria then that row is counted in (technically speaking boolean OR between the rows in criteria). If criteria specifies more than one columns then each of the conditions in these columns should be true that the row in database matches (again technically speaking boolean AND between the columns in each row 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.

dcount

## day

### Synopsis

day(serial_number)

### Description

Converts a serial number to a day.

### Examples

month time now year

## dcount

### Synopsis

dcount(database,field,criteria)

### Description

Dcount 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, i.e. 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 criterias are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifing a value, e.g. ``3'' or ``John''. Each row in criteria specifies a separate condition, i.e. if a row in database matches with one of the rows in criteria then that row is counted in (technically speaking boolean OR between the rows in criteria). If criteria specifies more than one columns then each of the conditions in these columns should be true that the row in database matches (again technically speaking boolean AND between the columns in each row 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.

daverage

## dcounta

### Synopsis

dcounta(database,field,criteria)

### Description

Dcounta 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, i.e. 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 criterias are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifing a value, e.g. ``3'' or ``John''. Each row in criteria specifies a separate condition, i.e. if a row in database matches with one of the rows in criteria then that row is counted in (technically speaking boolean OR between the rows in criteria). If criteria specifies more than one columns then each of the conditions in these columns should be true that the row in database matches (again technically speaking boolean AND between the columns in each row 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.

dcount

## dec2bin

### Synopsis

dec2bin(number[,places])

### Description

Dec2bin 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 error is returned. This function is Excel compatible.

### Examples

dec2bin(42) equals 101010.

bin2dec dec2oct dec2hex

## dec2hex

### Synopsis

dec2hex(number[,places])

### Description

Dec2hex 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 error is returned. This function is Excel compatible.

### Examples

dec2hex(42) equals 2A.

hex2dec dec2bin dec2oct

## dec2oct

### Synopsis

dec2oct(number[,places])

### Description

Dec2oct 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 error is returned. This function is Excel compatible.

### Examples

dec2oct(42) equals 52.

oct2dec dec2bin dec2hex

## define

### Synopsis

define(variable, value)

### Description

A special form used to assign a value to a variable:

define(variable, value)

The variable can then be used in other places in the sheet.

### Examples

Let's say that A1 contains the value 2 and B1 contains the value 3.

define(foo, a1*b1) returns 6 and also defines the variable foo.

foo returns 6 after the definition above.

## 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.

## delta

delta(x[,y])

### Description

Delta tests for numerical equivilance of two arguments returning 1 in equality y is optional, and defaults to 0.

If either argument is non-numeric returns a error. This function is Excel compatible.

### Examples

delta(42.99,43) equals 0.

exact gestep

## devsq

### Synopsis

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.

stdev

## dget

### Synopsis

dget(database,field,criteria)

### Description

Dget 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, i.e. 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 criterias are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifing a value, e.g. ``3'' or ``John''. Each row in criteria specifies a separate condition, i.e. if a row in database matches with one of the rows in criteria then that row is counted in (technically speaking boolean OR between the rows in criteria). If criteria specifies more than one columns then each of the conditions in these columns should be true that the row in database matches (again technically speaking boolean AND between the columns in each row 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

dget(A1..C7, "Salary", A9..A10) equals 34323.

dget(A1..C7, "Name", A9..A10) equals "Clark".

If none of the items match the conditions, dget returns error. If more than one items match the conditions, dget returns error.

dcount

## dmax

### Synopsis

dmax(database,field,criteria)

### Description

Dmax 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, i.e. 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 criterias are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifing a value, e.g. ``3'' or ``John''. Each row in criteria specifies a separate condition, i.e. if a row in database matches with one of the rows in criteria then that row is counted in (technically speaking boolean OR between the rows in criteria). If criteria specifies more than one columns then each of the conditions in these columns should be true that the row in database matches (again technically speaking boolean AND between the columns in each row 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.

dmin

## dmin

### Synopsis

dmin(database,field,criteria)

### Description

Dmin 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, i.e. 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 criterias are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifing a value, e.g. ``3'' or ``John''. Each row in criteria specifies a separate condition, i.e. if a row in database matches with one of the rows in criteria then that row is counted in (technically speaking boolean OR between the rows in criteria). If criteria specifies more than one columns then each of the conditions in these columns should be true that the row in database matches (again technically speaking boolean AND between the columns in each row 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.

dmax

## dollar

### Synopsis

dollar(num[,decimals])

### Description

Dollar returns num formatted as currency.

### Examples

dollar(12345) equals "\$12,345.00".

fixed text value

## dproduct

### Synopsis

dproduct(database,field,criteria)

### Description

Dproduct 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, i.e. 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 criterias are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifing a value, e.g. ``3'' or ``John''. Each row in criteria specifies a separate condition, i.e. if a row in database matches with one of the rows in criteria then that row is counted in (technically speaking boolean OR between the rows in criteria). If criteria specifies more than one columns then each of the conditions in these columns should be true that the row in database matches (again technically speaking boolean AND between the columns in each row 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.

dsum

## drem

drem(x, y)

### Description

The drem() function computes the remainder of dividing x by y. The return value is x - n * y, where n is the quo- tient of x / y, rounded to the nearest integer. If the quotient is 1/2, it is rounded to the even number.

fmod

## dstdev

### Synopsis

dstdev(database,field,criteria)

### Description

Dstdev 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, i.e. 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 criterias are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifing a value, e.g. ``3'' or ``John''. Each row in criteria specifies a separate condition, i.e. if a row in database matches with one of the rows in criteria then that row is counted in (technically speaking boolean OR between the rows in criteria). If criteria specifies more than one columns then each of the conditions in these columns should be true that the row in database matches (again technically speaking boolean AND between the columns in each row 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.

dstdevp

## dstdevp

### Synopsis

dstdevp(database,field,criteria)

### Description

Dstdevp 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, i.e. 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 criterias are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifing a value, e.g. ``3'' or ``John''. Each row in criteria specifies a separate condition, i.e. if a row in database matches with one of the rows in criteria then that row is counted in (technically speaking boolean OR between the rows in criteria). If criteria specifies more than one columns then each of the conditions in these columns should be true that the row in database matches (again technically speaking boolean AND between the columns in each row 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.

dstdev

## dsum

### Synopsis

dsum(database,field,criteria)

### Description

Dsum 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, i.e. 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 criterias are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifing a value, e.g. ``3'' or ``John''. Each row in criteria specifies a separate condition, i.e. if a row in database matches with one of the rows in criteria then that row is counted in (technically speaking boolean OR between the rows in criteria). If criteria specifies more than one columns then each of the conditions in these columns should be true that the row in database matches (again technically speaking boolean AND between the columns in each row 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.

dproduct

## duration

### Synopsis

duration(rate,pv,fv)

### Description

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.

ppmt pv fv

## dvar

### Synopsis

dvar(database,field,criteria)

### Description

Dvar 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, i.e. 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 criterias are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifing a value, e.g. ``3'' or ``John''. Each row in criteria specifies a separate condition, i.e. if a row in database matches with one of the rows in criteria then that row is counted in (technically speaking boolean OR between the rows in criteria). If criteria specifies more than one columns then each of the conditions in these columns should be true that the row in database matches (again technically speaking boolean AND between the columns in each row 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.

dvarp

## dvarp

### Synopsis

dvarp(database,field,criteria)

### Description

Dvarp 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, i.e. 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 criterias are for. Cells below the labels specify conditions, for example, ``>3'' or ``<9''. Equality condition can be given simply by specifing a value, e.g. ``3'' or ``John''. Each row in criteria specifies a separate condition, i.e. if a row in database matches with one of the rows in criteria then that row is counted in (technically speaking boolean OR between the rows in criteria). If criteria specifies more than one columns then each of the conditions in these columns should be true that the row in database matches (again technically speaking boolean AND between the columns in each row 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.

dvar

## effect

effect(r,nper)

### Description

Effect calculates the effective interest rate from a given nominal rate.

Effective interest rate is calculated using this formulae:

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

where:

r = nominal interest rate (stated in yearly terms)

nper = number of periods used for compounding

### 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.

nominal

## erf

erf(x)

### Description

ERF function returns the integral of the error function between zero and x. Excel compatible.

### Examples

ERF(0.4) equals 0.428392355.

erfc

## erfc

erfc(x)

### Description

The ERFC function returns the integral of the complimentary error function between the limits 0 and x.

erf

## 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)

FIM (Finland)

FRF (France)

IEP (Ireland)

ITL (Italy)

LUF (Luxemburg)

NLG (Netherlands)

PTE (Portugal)

If the given currency is other than one of the above, EURO returns error.

### Examples

euro("DEM") returns 1.95583.

currency_rate

## even

even(number)

### Description

Even returns the number rounded up to the nearest even integer. Excel compatible.

### Examples

even(5.4) equals 6.

odd

## exact

### Synopsis

exact(string1, string2)

### Description

Exact returns true if string1 is exactly equal to string2 (this routine is case sensitive).

### Examples

exact("key","key") equals TRUE.

len

## exp

exp(x)

### Description

Computes the exponential function of x.

## expm_1

expm_1(x)

### Description

expm_1(x) returns a value equivalent to `exp (x) - 1'. It is computed in a way that is accurate even if the value of x is near zero--a case where `exp (x) - 1' would be inaccurate due to subtraction of two numbers that are nearly equal.

exp log

## expondist

### Synopsis

expondist(x,y,cumulative)

### Description

Expondist 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.

poisson

## fabs

fabs(x)

### Description

FABS returns the absolute value of the number x.

### Examples

fabs(1) equals 1.

fabs(-3.14) equals 3.14.

abs

## 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.

## factdouble

### Synopsis

factdouble(number)

### Description

FACTDOUBLE returns the double factorial of a number.

If number is not an integer, it is truncated. If number is negative FACTDOUBLE returns error. Excel compatible.

### Examples

FACTDOUBLE(5) equals 15.

fact

## fdist

### Synopsis

fdist(x, dof1, dof2)

### Description

FDIST 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 error. If dof1 < 1 or dof2 < 1, FDIST returns error. Excel compatible.

### Examples

FDIST(2,5,5) equals 0.232511319.

finv

## finv

### Synopsis

finv(p, dof1, dof2)

### Description

FINV returns the inverse of the F probability distribution.

If p < 0 or p > 1 FINV returns error. If dof1 < 1 or dof2 < 1 FINV returns error. Excel compatible.

### Examples

FINV(0.2,2,4) equals 2.472135955.

fdist

## fisher

fisher(x)

### Description

FISHER returns the Fisher transformation at x.

If x is not-number FISHER returns error. If x <= -1 or x >= 1 FISHER returns error. Excel compatible.

### Examples

FISHER(0.332) equals 0.345074339.

skew

## fisherinv

fisherinv(x)

### Description

FISHERINV returns the inverse of the Fisher transformation at x.

If x is non-number FISHERINV returns error. This function is Excel compatible.

### Examples

FISHERINV(2) equals 0.96402758.

fisher

## fixed

### Synopsis

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.

### Examples

FIXED(1234.567,2) equals "1,234.57".

## floor

floor(x)

### Description

The floor() function rounds x downwards to the nearest integer, returning that value as a double.

### Examples

floor(3.14) equals 3.

floor(-3.14) equals -4.

ceil

## fmod

fmod(x)

### Description

Floating point mod.

## fv

### Synopsis

fv(rate,term,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, term 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 begining of the period. If type = 0 it is made at the end of each period.

pv pmt ppmt

## g_product

### Synopsis

g_product(value1, value2, ...)

### Description

PRODUCT returns the product of all the values and cells referenced in the argument list. Empty cells are ignored and the empty product in 1.

### Examples

G_PRODUCT(2,5,9) equals 90.

sum count

### Description

GAMMADIST 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 error. If alpha <= 0 or beta <= 0, GAMMADIST returns error. Excel compatible.

gammainv

## gammainv

### Synopsis

gammainv(p,alpha,beta)

### Description

GAMMAINV returns the inverse of the cumulative gamma distribution.

If p < 0 or p > 1 GAMMAINV returns error. If alpha <= 0 or beta <= 0 GAMMAINV returns error. This function is Excel compatible.

### Examples

gammainv(0.34,2,4) equals 4.829093908.

## gammaln

gammaln(x)

### Description

gammaln returns the natural logarithm of the gamma function.

If x is non-number then gammaln returns error. If x <= 0 then gammaln returns error. Excel compatible.

### Examples

gammaln(23) equals 48.471181352.

poisson

## gcd

### Synopsis

gcd(number1,number2,...)

### Description

gcd returns the greatest common divisor of given numbers.

If any of the arguments is less than zero, gcd returns error. If any of the arguments is a non-integer, it is truncated. This function is Excel compatible.

### Examples

gcd(470,770) equals 10.

gcd(470,770,1495) equals 5.

lcm

## geomean

### Synopsis

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.

average harmean median mode trimmean

## gestep

gestep(x[,y])

### Description

gestep 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 error. This function is Excel compatible.

### Examples

gestep(5,4) equals 1.

delta

## get_cell

### Synopsis

get_cell(row, column, [sheet])

### Description

Returns the value in the specified row and column. If a sheet is specified, it is used. Otherwise the current sheet is used.

### Examples

get_cell(2, 3) returns the value in row 2, column 3 in the current sheet.

get_cell(2, 3, "Sheet 2") returns the value in row 2, column 3 in the sheet named "Sheet 2".

get_cell(2, 3, "1998.siag:") returns the value in row 2, column 3 in the first sheet of buffer "1998.siag".

get_cell(2, 3, "1998.siag:January") returns the value in row 2, column 3 in the sheet named "January" in the buffer "1998.siag".

href vref

## getcwd

getcwd()

### Description

Returns the current working directory.

## getenv

getenv(name)

### Description

Returns the value of the environment variable named, or ().

## getgid

getgid()

### Description

Returns the group id of the process.

## gethostid

gethostid()

### Description

Returns a 32 bit number.

## gethostname

gethostname()

### Description

Returns the configured name of the host.

## getpgrp

getpgrp()

### Description

Returns the process group ID of the calling process.

## getpid

getpid()

### Description

Returns the process ID of the calling process.

## getppid

getppid()

### Description

Returns the parent process ID of the calling process.

## getuid

getuid()

### Description

Returns the uid of the current process.

## hex2bin

### Synopsis

hex2bin(number[,places])

### Description

The 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 error is returned. This function is Excel compatible.

### Examples

HEX2BIN("2A") equals 101010.

bin2hex hex2oct hex2dec

## hex2dec

hex2dec(x)

### Description

The HEX2DEC function converts a hexadecimal number to its decimal equivalent. Excel compatible.

### Examples

HEX2DEC("2A") equals 42.

dec2hex hex2bin hex2oct

## hex2oct

### Synopsis

hex2oct(number[,places])

### Description

The 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 error is returned. This function is Excel compatible.

### Examples

HEX2OCT("2A") equals 52.

oct2hex hex2bin hex2dec

## hlookup

### Synopsis

hlookup(value,range,row[,approximate])

### Description

HLOOKUP 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 equivilance. 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. Returns error if row < 0. Returns error if row falls outside range.

vlookup

## hour

### Synopsis

hour(serial_number)

### Description

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.).

### Examples

minute now time second

## href

href(x)

### Description

Returns the contents from the cell x positions to the right.

### Examples

href(-2) returns the cell 2 positions to the left.

vref

### Description

The HYPERLINK function currently returns its 2nd argument, or if that is omitted the 1st argument.

## hypgeomdist

### Synopsis

hypgeomdist(x, n, M, N)

### Description

HYPGEOMDIST 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 thepopulation size.

If x,n,M or N is a non-integer it is truncated. If x,n,M or N < 0 HYPGEOMDIST returns error. If x > M or n > N HYPGEOMDIST returns error. Excel compatible.

### Examples

HYPGEOMDIST(1,2,3,10) equals 0.4666667.

binomdist poisson

## hypot

hypot(x, y)

### Description

The hypot() function returns the sqrt(x*x + y*y). This is the length of the hypotenuse of a right-angle triangle with sides of length x and y, or the distance of the point (x, y) from the origin.

sqrt

## imabs

imabs(inumber)

### Description

IMABS returns the absolute value of a complex number. This function is Excel compatible.

### Examples

IMABS("2-j") equals 2.23606798.

imaginary imreal

## imaginary

### Synopsis

imaginary(inumber)

### Description

IMAGINARY returns the imaginary coefficient of a complex number. This function is Excel compatible.

### Examples

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

imreal

## imargument

### Synopsis

imargument(inumber)

### Description

IMARGUMENT returns the argument theta of a complex number. This function is Excel compatible.

### Examples

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

## imconjugate

### Synopsis

imconjugate(inumber)

### Description

IMCONJUGATE returns the complex conjugate of a complex number. This function is Excel compatible.

### Examples

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

imaginary imreal

## imcos

imcos(inumber)

### Description

IMCOS returns the cosine of a complex number. This function is Excel compatible.

### Examples

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

imsin imtan

## imdiv

### Synopsis

imdiv(inumber,inumber)

### Description

IMDIV returns the quotient of two complex numbers. This function is Excel compatible.

### Examples

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

improduct

## imexp

imexp(inumber)

### Description

IMEXP returns the exponential of a complex number. This function is Excel compatible.

### Examples

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

imln

## imln

imln(inumber)

### Description

IMLN returns the natural logarithm of a complex number. (The result will have an imaginary part between -pi an +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.) This function is Excel compatible.

### Examples

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

imexp imlog2 imlog10

## imlog_10

### Synopsis

imlog_10(inumber)

### Description

IMLOG_10 returns the logarithm of a complex number in base 10. This function is Excel compatible.

### Examples

IMLOG_10("3-j") equals 0.5-0.13973j.

imln imlog_2

## imlog_2

imlog_2(inumber)

### Description

IMLOG_2 returns the logarithm of a complex number in base 2. This function is Excel compatible.

### Examples

IMLOG_2("3-j") equals 1.66096-0.46419j.

imln imlog_10

## impower

### Synopsis

impower(inumber,number)

### Description

IMPOWER returns a complex number raised to a power. inumber is the complex number to be raised to a power and number is the power to which you want to raise the complex number. This function is Excel compatible.

### Examples

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

imsqrt

## improduct

### Synopsis

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

### Description

IMPRODUCT returns the product of given complex numbers. This function is Excel compatible.

### Examples

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

imdiv

## imreal

imreal(inumber)

### Description

IMREAL returns the real coefficient of a complex number. This function is Excel compatible.

### Examples

imreal("132-j") equals 132.

imaginary

## imsin

imsin(inumber)

### Description

IMSIN returns the sine of a complex number. This function is Excel compatible.

### Examples

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

imcos imtan

## imsqrt

imsqrt(inumber)

### Description

IMSQRT returns the square root of a complex number. This function is Excel compatible.

### Examples

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

impower

## imsub

### Synopsis

imsub(inumber,inumber)

### Description

IMSUB returns the difference of two complex numbers. This function is Excel compatible.

### Examples

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

imsum

## imsum

### Synopsis

imsum(inumber,inumber)

### Description

IMSUM returns the sum of two complex numbers. This function is Excel compatible.

### Examples

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

imsub

## imtan

imtan(inumber)

### Description

IMTAN returns the tangent of a complex number. This function is Excel compatible.

imsin imcos

### Description

Converts a "x.x.x.x" dotted notation string or a byte array into a number.

## info

info()

### Description

INFO returns information about the current operating environment. This function is Excel compatible.

## int

int(a)

### Description

INT rounds a now to the nearest integer where `nearest' implies being closer to zero. INT is equivalent to FLOOR(a) for a >= 0, and CEIL(a) for a < 0. Excel compatible.

### Examples

INT(7.2) equals 7.

INT(-5.5) equals -6.

floor ceil abs

## isblank

isblank(exp)

### Description

ISBLANK returns TRUE if the value is blank. This function is Excel compatible.

## iseven

iseven(x)

### Description

ISEVEN returns TRUE if the number is even. This function is Excel compatible.

isodd

## islogical

islogical(x)

### Description

ISLOGICAL returns TRUE if the value is a logical value. This function is Excel compatible.

## isna

isna(x)

### Description

ISNA returns TRUE if the value is the #N/A error value. This function is Excel compatible.

## isnontext

isnontext(x)

### Description

ISNONTEXT Returns TRUE if the value is not text. This function is Excel compatible.

istext

## isnumber

isnumber(x)

### Description

ISNUMBER returns TRUE if the value is a number. This function is Excel compatible.

## isodd

isodd()

### Description

ISODD returns TRUE if the number is odd. This function is Excel compatible.

iseven

## ispmt

### Synopsis

ispmt(rate,per,nper,pv)

### Description

ISPMT returns the interest paid on a given period.

If per < 1 or per > nper, ISPMT returns error.

pv

## istext

istext()

### Description

ISTEXT returns TRUE if the value is text. This function is Excel compatible.

isnontext

## j_0

j_0(x)

### Description

The j_0() and j_1() functions return Bessel functions of x of the first kind of orders 0 and 1, respectively.

### Examples

j_1 jn y_0 y_1 yn

## j_1

j_1(x)

### Description

The j_0() and j_1() functions return Bessel functions of x of the first kind of orders 0 and 1, respectively.

### Examples

j_0 jn y_0 y_1 yn

## jn

jn(n, x)

### Description

The jn() function returns the Bessel function of x of the first kind of order n.

### Examples

j_0 j_1 y_0 y_1 yn

## kurt

### Synopsis

kurt(n1, n2, ...)

### Description

KURT returns an unbiased estimate of the kurtosis of a data set.

Note, that this is only meaningful is 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 error. 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.

average var skew kurtp

## kurtp

### Synopsis

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 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.

average varp skewp kurt

## large

### Synopsis

large(n1, n2, ..., k)

### Description

LARGE returns the k-th largest value in a data set.

If data set is empty LARGE returns error. If k <= 0 or k is greater than the number of data items given LARGE returns error. 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.

percentile percentrank quartile small

## lcm

### Synopsis

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 error. Excel compatible. Requires the GMP library.

### Examples

LCM(2,13) equals 26.

LCM(4,7,5) equals 140.

gcd

## left

### Synopsis

left(text[,num_chars])

### Description

LEFT returns the leftmost num_chars characters or the left character if num_chars is not specified.

### Examples

LEFT("Directory",3) equals "Dir".

mid right

## len

len(string)

### Description

LEN returns the length in characters of the string string.

### Examples

len("Helsinki") equals 8.

char code

## length

length()

### Description

Returns the length of an object which may be a string (acts like strlen) or a list, or an array.

## lgamma

lgamma(x)

### Description

The lgamma() function returns the log of the absolute value of the Gamma function.

infnan

## ln

ln(x)

### Description

LN returns the natural logarithm of x. If x <= 0, LN returns error. Excel compatible.

### Examples

LN(7) equals 1.94591.

exp log_2 log_10

## log

log(x)

### Description

Computes the natural logarithm of x.

## log1p

log1p(x)

### Description

log1p(x) returns a value equivalent to `log (1 + x)'. It is computed in a way that is accurate even if the value of x is near zero.

exp log

## log_10

log_10(x)

### Description

The log10() function returns the base-10 logarithm of x.

log

## log_2

log_2(x)

### Description

LOG_2 computes the base-2 logarithm of x. If x <= 0, LOG_2 returns error. The name of this functions is log_2 rather than log2, otherwise Siag would interpret the name as a reference.

### Examples

LOG_2(1024) equals 10.

exp log_10 log

### Description

LOGINV 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 stdev is the standard deviation of the distribution.

If p < 0 or p > 1 or stdev <= 0 LOGINV returns error. This function is Excel compatible.

### Examples

exp ln log log10 lognormdist

## lognormdist

### Synopsis

lognormdist(x,mean,stdev)

### Description

lognormdist returns the lognormal distribution. x is the value for which you want the distribution, mean is the mean of the distribution, and stdev is the standard deviation of the distribution. Excel compatible.

If stdev = 0 lognormdist returns error. If x <= 0, mean < 0 or stdev < 0 lognormdist returns error.

### Examples

lognormdist(3,1,2) equals 0.519662338.

normdist

## lower

lower(text)

### Description

LOWER returns a lower-case version of the string in text.

### Examples

LOWER("J. F. Kennedy") equals "j. f. kennedy".

upper

## max

max(x1, x2, ...)

### Description

Returns the maximum of x1, x2, etc.

r_max

## maxa

### Synopsis

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

MINA(A1..A5) equals 0.

max mina

## median

### Synopsis

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.

average count counta daverage mode sum

## min

min(x1, x2, ...)

### Description

Returns the numerical minimum of its arguments.

r_min

## mina

### Synopsis

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

MAXA(A1..A5) equals 40.1.

min maxa

## minute

### Synopsis

minute(serial_number)

### Description

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

### Examples

hour now time second

## mmult

### Synopsis

mmult(array1,array2)

### Description

MMULT 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. Excel compatible.

### Examples

transpose minverse

## mod

### Synopsis

mod(number,divisor)

### Description

MOD returns the remainder when divisor is divided into number. Excel compatible.

MOD returns error if divisor is zero.

### Examples

MOD(23,7) equals 2.

int floor ceil

## month

### Synopsis

month(serial_number)

### Description

Converts a serial number to a month.

### Examples

day time now year

## mpf_abs

mpf_abs(op)

### Description

Set ROP to the absolute value of OP.

### Description

Set ROP to OP1 + OP2.

## mpf_ceil

mpf_ceil(op)

### Description

Set ROP to OP rounded to an integer. `mpf_ceil' rounds to the next higher integer, `mpf_floor' to the next lower, and `mpf_trunc' to the integer towards zero.

### Examples

mpf_floor mpf_trunc

## mpf_cmp

### Synopsis

mpf_cmp(op1, op2)

### Description

Compare OP1 and OP2. Return a positive value if OP1 > OP2, zero if OP1 = OP2, and a negative value if OP1 < OP2.

## mpf_div

### Synopsis

mpf_div(op1, op2)

### Description

Set ROP to OP1/OP2.

## mpf_div_2exp

### Synopsis

mpf_div_2exp(op1, op2)

### Description

Set ROP to OP1 divided by 2 raised to OP2.

## mpf_eq

### Synopsis

mpf_eq(op1, op2, op3)

### Description

Return non-zero if the first OP3 bits of OP1 and OP2 are equal, zero otherwise. I.e., test if OP1 and OP2 are approximately equal.

## mpf_floor

mpf_floor(op)

### Description

Set ROP to OP rounded to an integer. `mpf_ceil' rounds to the next higher integer, `mpf_floor' to the next lower, and `mpf_trunc' to the integer towards zero.

### Examples

mpf_ceil mpf_trunc

## mpf_mul

### Synopsis

mpf_mul(op1, op2)

### Description

Set ROP to OP1 times OP2.

## mpf_mul_2exp

### Synopsis

mpf_mul_2exp(op1, op2)

### Description

Set ROP to OP1 times 2 raised to OP2.

mpf_neg(op)

Set ROP to -OP.

## mpf_pow_ui

### Synopsis

mpf_pow_ui(op1, op2)

### Description

Set ROP to OP1 raised to the power OP2.

## mpf_reldiff

### Synopsis

mpf_reldiff(op1, op2)

### Description

Compute the relative difference between OP1 and OP2 and store the result in ROP.

## mpf_sgn

mpf_sgn(op)

### Description

Return +1 if OP > 0, 0 if OP = 0, and -1 if OP < 0.

## mpf_sqrt

mpf_sqrt(op)

### Description

Set ROP to the square root of OP.

## mpf_sub

### Synopsis

mpf_sub(op1, op2)

### Description

Set ROP to OP1 - OP2.

## mpf_trunc

mpf_trunc(op)

### Description

Set ROP to OP rounded to an integer. `mpf_ceil' rounds to the next higher integer, `mpf_floor' to the next lower, and `mpf_trunc' to the integer towards zero.

### Examples

mpf_floor mpf_ceil

## mpz_abs

mpz_abs(op)

### Description

Set ROP to the absolute value of OP.

### Description

Computes a+b for integers of arbitrary size.

## mpz_and

### Synopsis

mpz_and(op1, op2)

### Description

Set ROP to OP1 logical-and OP2.

## mpz_bin_ui

mpz_bin_ui(n, k)

### Description

Compute the binomial coefficient N over K and store the result in ROP.

## mpz_cdiv_q

mpz_cdiv_q(n, d)

### Description

Set Q to N/D, rounded towards +infinity.

## mpz_cdiv_r

mpz_cdiv_r(n, d)

### Description

Set R to (N - N/D * D), where the quotient is rounded towards +infinity. Unless R becomes zero, it will get the opposite sign as D.

## mpz_clrbit

### Synopsis

mpz_clrbit(rop, bit_index)

### Description

Clear bit BIT_INDEX in ROP.

## mpz_cmp

### Synopsis

mpz_cmp(op1, op2)

### Description

Compare OP1 and OP2. Return a positive value if OP1 > OP2, zero if OP1 = OP2, and a negative value if OP1 < OP2.

## mpz_cmpabs

### Synopsis

mpz_cmpabs(op1, op2)

### Description

Compare the absolute values of OP1 and OP2. Return a positive value if OP1 > OP2, zero if OP1 = OP2, and a negative value if OP1 < OP2.

## mpz_com

mpz_com(op)

### Description

Set ROP to the one's complement of OP.

## mpz_divexact

### Synopsis

mpz_divexact(n, d)

### Description

Set Q to N/D. This function produces correct results only when it is known in advance that D divides N.

Since mpz_divexact is much faster than any of the other routines that produce the quotient (*note References:: Jebelean), it is the best choice for instances in which exact division is known to occur, such as reducing a rational to lowest terms.

## mpz_fac_ui

mpz_fac_ui(op)

### Description

Set ROP to OP!, the factorial of OP.

## mpz_fdiv_q

mpz_fdiv_q(n, d)

### Description

Set Q to N/D, rounded towards -infinity.

## mpz_fdiv_q_2exp

### Synopsis

mpz_fdiv_q_2exp(n, d)

### Description

Set Q to N divided by 2 raised to D, rounded towards -infinity.

## mpz_fdiv_r

mpz_fdiv_r(n, d)

### Description

Set R to (N - N/D * D), where the quotient is rounded towards -infinity. Unless R becomes zero, it will get the same sign as D.

## mpz_fdiv_r_2exp

### Synopsis

mpz_fdiv_r_2exp(n, d)

### Description

Divide N by (2 raised to D) and put the remainder in R. The sign of R will always be positive.

This operation can also be defined as masking of the D least significant bits.

## mpz_fib_ui

mpz_fib_ui(n)

### Description

Compute the Nth Fibonacci number and store the result in ROP.

## mpz_gcd

### Synopsis

mpz_gcd(op1, op2)

### Description

Set ROP to the greatest common divisor of OP1 and OP2. The result is always positive even if either of or both input operands are negative.

## mpz_hamdist

### Synopsis

mpz_hamdist(op1, op2)

### Description

If OP1 and OP2 are both non-negative, return the hamming distance between the two operands. Otherwise, return the largest possible value (MAX_ULONG).

## mpz_invert

### Synopsis

mpz_invert(op1, op2)

### Description

Compute the inverse of OP1 modulo OP2 and put the result in ROP. Return non-zero if an inverse exist, zero otherwise. When the function returns zero, ROP is undefined.

## mpz_ior

### Synopsis

mpz_ior(op1, op2)

### Description

Set ROP to OP1 inclusive-or OP2.

## mpz_jacobi

### Synopsis

mpz_jacobi(op1, op2)

### Description

Compute the Jacobi and Legendre symbols, respectively.

mpz_legendre

## mpz_lcm

### Synopsis

mpz_lcm(op1, op2)

### Description

Set ROP to the least common multiple of OP1 and OP2.

## mpz_legendre

### Synopsis

mpz_legendre(op1, op2)

### Description

Compute the Jacobi and Legendre symbols, respectively.

mpz_jacobi

## mpz_mod

mpz_mod(n, d)

### Description

Set R to N `mod' D. The sign of the divisor is ignored; the result is always non-negative.

## mpz_mul

mpz_mul(a, b)

### Description

Computes a*b for integers of arbitrary size.

## mpz_mul_2exp

### Synopsis

mpz_mul_2exp(op1, op2)

### Description

Set ROP to OP1 times 2 raised to OP2. This operation can also be defined as a left shift, OP2 steps.

mpz_neg(op)

Set ROP to -OP.

## mpz_nextprime

### Synopsis

mpz_nextprime(op)

### Description

Set ROP to the next prime greater than OP.

This function uses a probabilistic algorithm to identify primes, but for for practical purposes it's adequate, since the chance of a composite passing will be extremely small.

## mpz_perfect_power_p

### Synopsis

mpz_perfect_power_p(op)

### Description

Return non-zero if OP is a perfect power, i.e., if there exist integers A and B, with B > 1, such that OP equals a raised to b. Return zero otherwise.

## mpz_perfect_square_p

### Synopsis

mpz_perfect_square_p(op)

### Description

Return non-zero if OP is a perfect square, i.e., if the square root of OP is an integer. Return zero otherwise.

## mpz_popcount

mpz_popcount(op)

### Description

For non-negative numbers, return the population count of OP. For negative numbers, return the largest possible value (MAX_ULONG).

## mpz_pow_ui

### Synopsis

mpz_pow_ui(base, exp)

### Description

Set ROP to BASE raised to EXP. The case of 0^0 yields 1.

## mpz_powm

### Synopsis

mpz_powm(base, exp, mod)

### Description

Set ROP to (BASE raised to EXP) `mod' MOD. If EXP is negative, the result is undefined.

## mpz_probab_prime_p

### Synopsis

mpz_probab_prime_p(n, reps)

### Description

If this function returns 0, N is definitely not prime. If it returns 1, then N is `probably' prime. If it returns 2, then N is surely prime. Reasonable values of reps vary from 5 to 10; a higher value lowers the probability for a non-prime to pass as a `probable' prime.

The function uses Miller-Rabin's probabilistic test.

## mpz_remove

### Synopsis

mpz_remove(op, f)

### Description

Remove all occurrences of the factor F from OP and store the result in ROP.

## mpz_root

mpz_root(op, n)

### Description

Set ROP to the truncated integer part of the Nth root of OP. Return non-zero if the computation was exact, i.e., if OP is ROP to the Nth power.

## mpz_scan0

### Synopsis

mpz_scan0(op, starting_bit)

### Description

Scan OP, starting with bit STARTING_BIT, towards more significant bits, until the first clear bit is found. Return the index of the found bit.

## mpz_scan1

### Synopsis

mpz_scan1(op, starting_bit)

### Description

Scan OP, starting with bit STARTING_BIT, towards more significant bits, until the first set bit is found. Return the index of the found bit.

## mpz_setbit

### Synopsis

mpz_setbit(rop, bit_index)

### Description

Set bit BIT_INDEX in ROP.

## mpz_sgn

mpz_sgn(op)

### Description

Return +1 if OP > 0, 0 if OP = 0, and -1 if OP < 0.

## mpz_sizeinbase

### Synopsis

mpz_sizeinbase(op, base)

### Description

Return the size of OP measured in number of digits in base BASE. The base may vary from 2 to 36. The returned value will be exact or 1 too big. If BASE is a power of 2, the returned value will always be exact.

## mpz_sqrt

mpz_sqrt(op)

### Description

Set ROP to the truncated integer part of the square root of OP.

## mpz_sub

mpz_sub(a, b)

### Description

Computes a-b for integers of arbitrary size.

## mpz_tdiv_q

mpz_tdiv_q(n, d)

### Description

Set Q to [N/D], truncated towards 0.

## mpz_tdiv_q_2exp

### Synopsis

mpz_tdiv_q_2exp(n, d)

### Description

Set Q to N divided by 2 raised to D. The quotient is truncated towards 0.

## mpz_tdiv_r

mpz_tdiv_r(n, d)

### Description

Set R to (N - [N/D] * D), where the quotient is truncated towards 0. Unless R becomes zero, it will get the same sign as N.

## mpz_tdiv_r_2exp

### Synopsis

mpz_tdiv_r_2exp(n, d)

### Description

Divide N by (2 raised to D) and put the remainder in R. Unless it is zero, R will have the same sign as N.

## mpz_tstbit

### Synopsis

mpz_tstbit(op, bit_index)

### Description

Check bit BIT_INDEX in OP and return 0 or 1 accordingly.

## mpz_xor

### Synopsis

mpz_xor(op1, op2)

### Description

Set ROP to OP1 exclusive-or OP2.

## mround

### Synopsis

mround(number,multiple)

### Description

MROUND 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 error. Excel compatible.

### Examples

MROUND(1.7,0.2) equals 1.8.

MROUND(321.123,0.12) equals 321.12.

rounddown round roundup

## n

n(x)

### Description

N returns a value converted to a number. Strings containing text are converted to the zero value. Excel compatible.

## negbinomdist

### Synopsis

negbinomdist(f,t,p)

### Description

negbinomdist 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 error. If p < 0 or p > 1 negbinomdist returns error. Excel compatible.

### Examples

negbinomdist(2,5,0.55) equals 0.152872629.

binomdist combin fact hypgeomdist permut

## nominal

### Synopsis

nominal(rate, 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

effect

## normdist

### Synopsis

normdist(x,mean,stdev,cumulative)

### Description

normdist returns the normal cumulative distribution. x is the value for which you want the distribution, mean is the mean of the distribution, stdev is the standard deviation.

If stdev is 0 normdist returns error. This function is Excel compatible.

### Examples

normdist(2,1,2,0) equals 0.176032663.

poisson

## norminv

### Synopsis

norminv(p,mean,stdev)

### Description

norminv 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 stdev is the standard deviation of the distribution.

If p < 0 or p > 1 or stdev <= 0 norminv returns error. This function is Excel compatible.

### Examples

norminv(0.76,2,3) equals 4.118907689.

normdist normsdist normsinv standardize ztest

## normsdist

normsdist(x)

### Description

normsdist returns the standard normal cumulative distribution. x is the value for which you want the distribution. Excel compatible.

### Examples

normsdist(2) equals 0.977249868.

normdist

## normsinv

normsinv(p)

### Description

normsinv returns the inverse of the standard normal cumulative distribution. p is the given probability corresponding to the normal distribution. Excel compatible.

If p < 0 or p > 1 normsinv returns error.

### Examples

normsinv(0.2) equals -0.841621234.

normdist norminv normsdist standardize ztest

## not

not(number)

### Description

NOT implements the logical NOT function: the result is TRUE if the number is zero; otherwise the result is FALSE.

Excel compatible. The name of this function is @NOT, to avoid clash with Scheme.

### Examples

NOT(0) equals TRUE.

NOT(TRUE) equals FALSE.

and or

## now

now()

### Description

Returns the serial number for the date and time at the time it is evaluated.

Serial Numbers in Siag are represented as seconds from 01/01/1970.

today now

## nper

### Synopsis

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 begining of the period, if type = 0, payments are due at the end of the period.

### Examples

For example, if you deposit \$10,000 in a savings account that earns an interest rate of 6%. To calculate how 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.

ppmt pv fv

## oct2bin

### Synopsis

oct2bin(number[,places])

### Description

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

If places is too small or negative error is returned.

### Examples

OCT2BIN("213") equals 10001011.

bin2oct oct2dec oct2hex

## oct2dec

oct2dec(x)

### Description

OCT2DEC converts an octal number in a string or number to its decimal equivalent. Excel compatible.

### Examples

OCT2DEC("124") equals 84.

dec2oct oct2bin oct2hex

## oct2hex

### Synopsis

oct2hex(number[,places])

### Description

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

If places is too small or negative error is returned.

### Examples

OCT2HEX(132) equals 5A.

hex2oct oct2bin oct2dec

## odd

odd(number)

### Description

ODD returns the number rounded up to the nearest odd integer. Excel compatible.

### Examples

ODD(4.4) equals 5.

even

## 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 an error is returned. Excel compatible. The name of the function is @OR.

### Examples

OR(TRUE,FALSE) equals TRUE.

OR(3>4,4<3) equals FALSE.

and not

## permut

permut(n,k)

### Description

PERMUT 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 error. If n < k PERMUT returns error. Excel compatible.

### Examples

PERMUT(7,3) equals 210.

combin

## pi

pi()

### Description

PI functions returns the value of Pi.

This function is called with no arguments. Excel compatible.

### Examples

PI() equals 3.141593.

sqrtpi

## pmt

### Synopsis

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

### Description

XXX: Below is a PV function description!PMT calculates the present value of an investment.

ppmt pv fv

## poisson

### Synopsis

poisson(x,mean,cumulative)

### Description

poisson 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 error. If mean <= 0 poisson returns the error. Excel compatible.

### Examples

poisson(3,6,0) equals 0.089235078.

normdist weibull

## pow

pow(x, y)

### Description

Computes the result of x raised to the y power.

pow_10(x)

pow_2(x)

## power

power(x,y)

### Description

POWER returns the value of x raised to the power y. Excel compatible.

### Examples

POWER(2,7) equals 128.

POWER(3,3.141) equals 31.523749.

exp

## ppmt

### Synopsis

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

ipmt pv fv

## product

### Synopsis

product(value1, value2, ...)

### Description

PRODUCT returns the product of all the values and cells referenced in the argument list. Excel compatible. In particular, this means that if all cells are empty, the result will be 0.

### Examples

PRODUCT(2,5,9) equals 90.

sum count g_product

## pv

### Synopsis

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 begining of the period. If type = 0 it is made at the end of each period.

fv

## pwr

pwr(y, n)

### Description

Compute an integral power of a double precision number.

## quotient

### Synopsis

quotient(num,den)

### Description

QUOTIENT returns the integer portion of a division. num is the divided and den is the divisor. This function is Excel compatible.

### Examples

QUOTIENT(23,5) equals 4.

mod

## r_avg

r_avg(a, b, ...)

### Description

Returns the average of all cells in the argument list. The arguments can be values, references or ranges.

### Examples

r_avg(a1..c2, e5) returns the average of all cells from a1 to c2 plus the value in e5.

r_max r_min r_sum

## r_max

r_max(a, b, ...)

### Description

Returns the largest value of all cells in the argument list. The arguments can be values, references or ranges.

### Examples

r_max(a1..c2, e5) returns the largest of all cells from a1 to c2 plus the value in e5.

r_sum r_min r_avg

## r_min

r_min(a, b, ...)

### Description

Returns the smallest value of all cells in the argument list. The arguments can be values, references or ranges.

### Examples

r_min(a1..c2, e5) returns the smallest of all cells from a1 to c2 plus the value in e5.

r_max r_sum r_avg

## r_sum

r_sum(a, b, ...)

### Description

Returns the sum of all cells in the argument list. The arguments can be values, references or ranges.

### Examples

r_sum(a1..c2, e5) returns the sum of all cells from a1 to c2 plus the value in e5.

r_max r_min r_avg

### Description

RADIANS computes the number of radians equivalent to x degrees. This function is Excel compatible.

pi degrees

## rand

rand(modulus)

### Description

Computes a random number from 0 to modulus-1. Uses C library rand.

random

## randbernoulli

randbernoulli(p)

### Description

RandBernoulli returns a Bernoulli distributed random number.

If p < 0 or p > 1 RandBernoulli returns error.

### Examples

RandBernoulli(0.5).

rand randbetween

## randbetween

### Synopsis

randbetween(bottom,top)

### Description

RANDBETWEEN returns a random integer number between bottom and top.

If bottom or top is non-integer, they are truncated. If bottom > top, RANDBETWEEN returns error. Excel compatible.

### Examples

RANDBETWEEN(3,7).

rand

## randbinom

### Synopsis

randbinom(p,trials)

### Description

RandBinom returns a binomialy distributed random number.

If p < 0 or p > 1 RandBinom returns error. If trials < 0 RandBinom returns error.

### Examples

RandBinom(0.5,2).

rand randbetween

## randexp

randexp(b)

### Description

RandExp returns a exponentially distributed random number.

RandExp(0.5).

rand randbetween

## randnegbinom

### Synopsis

randnegbinom(p,failures)

### Description

RANDNEGBINOM returns a negitive binomialy distributed random number.

If p < 0 or p > 1, RANDNEGBINOM returns error. If failures RANDNEGBINOM returns error.

### Examples

RANDNEGBINOM(0.5,2).

rand randbetween

## random

random(modulus)

### Description

Computes a random number from 0 to modulus-1. Uses C library random.

rand

## randpoisson

### Synopsis

randpoisson(lambda)

### Description

RandPoisson returns a poisson distributed random number.

RandPoisson(3).

rand randbetween

## realtime

realtime()

### Description

Returns a double precision floating point value representation of the current realtime number of seconds. Usually precise to about a thousandth of a second.

## rept

rept(string,num)

### Description

REPT returns num repetitions of string.

### Examples

REPT(".",3) equals "...".

concatenate

## roman

roman(x)

### Description

Converts between roman and decimal numbers. If x is a number or a string where the first character is a digit, converts to roman. Otherwise converts to number.

## round

### Synopsis

round(number[,digits])

### Description

ROUND 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. 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.

rounddown roundup

## rounddown

### Synopsis

rounddown(number[,digits])

### Description

ROUNDDOWN rounds a given number down, towards zero. 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.

round roundup

## roundup

### Synopsis

roundup(number[,digits])

### Description

ROUNDUP rounds a given number up, away from zero. 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.

round rounddown

## rows

rows(range)

### Description

The ROWS function returns the number of rows in area or array reference.

If reference is not an array nor a range returns error.

column row rows

## second

### Synopsis

second(serial_number)

### Description

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

### Examples

hour minute now time

## siag_colsum

### Synopsis

siag_colsum(c1, c2)

### Description

Returns the sum of all cells on the current row from column c1 to c2.

siag_rowsum

## siag_rowsum

### Synopsis

siag_rowsum(r1, r2)

### Description

Returns the sum of all cells in the current column from row r1 to r2.

siag_colsum

## sign

sign(number)

### Description

SIGN 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.

## sin

sin(x)

### Description

Computes the sine function of the angle x in radians.

cos

## sinh

sinh(x)

### Description

SINH function returns the hyperbolic sine of x, which is defined mathematically as (exp(x) - exp(-x)) / 2. Excel compatible.

### Examples

SINH(0.5) equals 0.521095.

sin cos cosh tan tanh degrees radians exp

## siod

siod()

### Description

Many functions are only available by using the SIOD interface.

## skew

### Synopsis

skew(n1, n2, ...)

### Description

SKEW returns an unbiased estimate for skewness of a distribution.

Note, that this is only meaningful is 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 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.

average var skewp kurt

## skewp

### Synopsis

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 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.

average varp skew kurtp

## sln

### Synopsis

sln(cost,salvage_value,life)

### Description

The SLN function will determine the straight line depreciation of an asset for a single period. The amount you paid for the asset is the cost, salvage is the value of the asset at the end of its useful life, and life is the number of periods over which an the asset is depreciated. This method of deprecition devides the cost evenly over the life of an asset.

The formula used for straight line depriciation is:

Depriciation expense = ( cost - salvage_value ) / life

cost = cost of an asset when acquired (market value). salvage_value = amount you get when asset sold at the end of the assets's useful life. life = anticipated life of an asset.

### 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.

syd

## small

### Synopsis

small(n1, n2, ..., k)

### Description

SMALL returns the k-th smallest value in a data set.

If data set is empty SMALL returns error. If k <= 0 or k is greater than the number of data items given SMALL returns error. 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.

percentile percentrank quartile large

## sqrt

sqrt(x)

### Description

Compute the square root of x.

pow pow2

## sqrtpi

sqrtpi(number)

### Description

SQRTPI returns the square root of a number multiplied by pi. Excel compatible.

### Examples

SQRTPI(2) equals 2.506628275.

pi

## standardize

### Synopsis

standardize(x, mean, stddev)

### Description

STANDARDIZE 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 error. This function is Excel compatible.

### Examples

STANDARDIZE(3,2,4) equals 0.25.

average

## stdev

### Synopsis

stdev(b1, b2, ...)

### Description

STDEV returns standard deviation of a set of numbers treating these numbers as members of a population. 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.

average dstdev dstdevp stdeva stdevpa var

## stdeva

### Synopsis

stdeva(number1,number2,...)

### Description

STDEVA returns the standard deviation based on a sample. 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.

stdev stdevpa

## stdevp

### Synopsis

stdevp(b1, b2, ...)

### Description

STDEVP returns standard deviation of a set of numbers treating these numbers as members of a complete population. 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.

stdev stdeva stdevpa

## stdevpa

### Synopsis

stdevpa(number1,number2,...)

### Description

STDEVPA returns the standard deviation based on the entire population. 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.

stdeva stdevp

## stock_max

### Synopsis

stock_max(symbol)

### Description

Fetches stock information from Yahoo over the Internet.

### Examples

stock_max("ABB.ST")

stock_yesterday stock_open stock_min stock_price stock_var stock_percent stock_volume

## stock_min

### Synopsis

stock_min(symbol)

### Description

Fetches stock information from Yahoo over the Internet.

### Examples

stock_min("ABB.ST")

stock_yesterday stock_open stock_price stock_max stock_var stock_percent stock_volume

## stock_open

### Synopsis

stock_open(symbol)

### Description

Fetches stock information from Yahoo over the Internet.

### Examples

stock_open("ABB.ST")

stock_yesterday stock_price stock_min stock_max stock_var stock_percent stock_volume

## stock_percent

### Synopsis

stock_percent(symbol)

### Description

Fetches stock information from Yahoo over the Internet.

### Examples

stock_percent("ABB.ST")

stock_yesterday stock_open stock_min stock_max stock_var stock_price stock_volume

## stock_price

### Synopsis

stock_price(symbol)

### Description

Fetches stock information from Yahoo over the Internet.

### Examples

stock_price("ABB.ST") returns the current price of ABB on the Stockholm stock exchange.

stock_yesterday stock_open stock_min stock_max stock_var stock_percent stock_volume

## stock_var

### Synopsis

stock_var(symbol)

### Description

Fetches stock information from Yahoo over the Internet.

### Examples

stock_var("ABB.ST")

stock_yesterday stock_open stock_min stock_max stock_price stock_percent stock_volume

## stock_volume

### Synopsis

stock_volume(symbol)

### Description

Fetches stock information from Yahoo over the Internet.

### Examples

stock_price("ABB.ST")

stock_yesterday stock_open stock_min stock_max stock_var stock_percent stock_price

## stock_yesterday

### Synopsis

stock_yesterday(symbol)

### Description

Fetches stock information from Yahoo over the Internet.

### Examples

stock_yesterday("ABB.ST")

stock_price stock_open stock_min stock_max stock_var stock_percent stock_volume

## strcmp

### Synopsis

strcmp(str1, str2)

### Description

Returns 0 if str1 and str2 are equal, or -1 if str1 is alphabetically less than str2 or 1 otherwise.

## strcspn

### Synopsis

strcspn(str, indicators)

### Description

Returns the location of the first character in str which is found in the indicators set, returns the length of the string if none found.

## strspn

### Synopsis

strspn(str, indicators)

### Description

Returns the location of the first character in str which is not found in the indicators set, returns the length of the str if none found.

## substring

### Synopsis

substring(str, start, end)

### Description

Returns a new string made up of the part of str begining at start and terminating at end. In other words, the new string has a length of end - start.

## sum

### Synopsis

sum(value1, value2, ...)

### Description

SUM computes the sum of all the values and cells referenced in the argument list. 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.

average count

## suma

### Synopsis

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). Since logical values are numbers in Siag, this function is identical to sum.

### Examples

Let us assume that the cells A1, A2, ..., A5 contain numbers 11, 15, 17, 21, and 43. Then

SUMA(A1..A5) equals 107.

average sum count

## sumif

### Synopsis

sumif(range,criteria[,actual_range])

### Description

SUMIF 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. 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.

countif sum

## sumproduct

### Synopsis

sumproduct(range1,range2,...)

### Description

SUMPRODUCT 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 dimentions, SUMPRODUCT returns error. 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.

sum product

## sumsq

### Synopsis

sumsq(value1, value2, ...)

### Description

SUMSQ returns the sum of the squares of all the values and cells referenced in the argument list. 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.

sum count

## sumx2my2

### Synopsis

sumx2my2(array1,array2)

### Description

SUMX2MY2 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 error. 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.

sumsq sumx2py2

## sumx2py2

### Synopsis

sumx2py2(array1,array2)

### Description

SUMX2PY2 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 error. 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.

sumsq sumx2my2

## sumxmy_2

### Synopsis

sumxmy_2(array1,array2)

### Description

SUMXMY_2 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 SUMXMY_2 is SUM (x-y)^2.

Strings and empty cells are simply ignored.

If array1 and array2 have different number of data points, SUMXMY2 returns error. 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

SUMXMY_2(A1..A5,B1..B5) equals 409.

sumsq sumx2my2 sumx2py2

## sxhash

### Synopsis

sxhash(data, modulus)

### Description

Computes a recursive hash of the data with respect to the specified modulus.

## syd

### Synopsis

syd(cost,salvage_value,life,period)

### Description

The SYD function calculates the sum-of-years digits depriciation 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 depriciation is:

Depriciation expense = ( cost - salvage_value ) * (life - period + 1) * 2 / life * (life + 1).

cost = cost of an asset when acquired (market value). salvage_value = amount you get when asset sold at the end of its useful life. life = anticipated life of an asset. period = period for which we need the expense.

### Examples

For example say a company purchases a new computer for \$5000 which has a salvage value of \$200, and a useful life of three 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.

sln

## tan

tan(x)

### Description

Computes the tagent of the angle x specified in radians.

atan

## tanh

tanh(x)

### Description

The TANH function returns the hyperbolic tangent of x, which is defined mathematically as sinh(x) / cosh(x). Excel compatible.

### Examples

TANH(2) equals 0.96402758.

tan sin sinh cos cosh degrees radians

## tbilleq

### Synopsis

tbilleq(settlement,maturity,discount)

### Description

TBILLEQ 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 error. If discount is negative, TBILLEQ returns error.

### Examples

tbillprice tbillyield

## tbillprice

### Synopsis

tbillprice(settlement,maturity,discount)

### Description

TBILLPRICE 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 error. If discount is negative, TBILLPRICE returns error.

### Examples

tbilleq tbillyield

## tbillyield

### Synopsis

tbillyield(settlement,maturity,pr)

### Description

TBILLYIELD 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 error. If pr is negative, TBILLYIELD returns error.

### Examples

tbilleq tbillprice

## tdist

### Synopsis

tdist(x,dof,tails)

### Description

TDIST 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.

If dof < 1 TDIST returns error. If tails is neither 1 or 2 TDIST returns error. Excel compatible.

### Examples

TDIST(2,5,1) equals 0.050969739.

tinv ttest

## time

### Synopsis

time(hours,minutes,seconds)

### Description

Returns a number representing the time of day.

hour

## timevalue

### Synopsis

timevalue(timetext)

### Description

Returns a number representing the time of day, a number between 0 and 86400.

hour

## tinv

tinv(p,dof)

### Description

TINV returns the inverse of the two-tailed Student's t-distribution.

If p < 0 or p > 1 or dof < 1 TINV returns error. This function is Excel compatible.

### Examples

TINV(0.4,32) equals 0.852998454.

tdist ttest

## totalheight

### Synopsis

totalheight(r1, r2)

### Description

Return the total height (in pixels) of all cells from r1 up to and including r2

### Examples

totalheight(3, 6)

totalwidth

## totalwidth

### Synopsis

totalwidth(c1, c2)

### Description

Return the total width (in pixels) of all cells from c1 up to and including c2

totalwidth(3, 6)

totalheight

## transpose

### Synopsis

transpose(matrix)

### Description

TRANSPOSE returns the transpose of the input matrix.

mmult

## trunc

trunc(x)

### Description

Returns the integer portion of x.

floor ceil

## upper

upper(text)

### Description

UPPER returns a upper-case version of the string in text.

### Examples

UPPER("canceled") equals "CANCELED".

lower

## var

var(b1, b2, ...)

### Description

VAR estimates the variance of a sample of a population. 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.

varp stdev

## vara

### Synopsis

vara(number1,number2,...)

### Description

VARA returns the variance based on a sample. 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. 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.

var varpa

## varp

### Synopsis

varp(b1, b2, ...)

### Description

VARP calculates the variance of a set of numbers where each number is a member of a population and the set is the 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.

average dvar dvarp stdev var

## varpa

### Synopsis

varpa(number1,number2,...)

### Description

VARPA returns the variance based on the entire population. 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.

varp

## vref

vref(x)

### Description

Returns the contents from the cell x positions down.

### Examples

vref(-2) returns the cell 2 positions up.

href

## weekday

### Synopsis

weekday(serial_number)

### Description

Converts a serial number to a weekday. XXX: explain.

### Examples

month time now year

## weibull

### Synopsis

weibull(x,alpha,beta,cumulative)

### Description

weibull 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 error. If alpha <= 0 or beta <= 0 weibull returns error. Excel compatible.

### Examples

weibull(3,2,4,0) equals 0.213668559.

poisson

## y_0

y_0(x)

### Description

The y_0() and y_1() functions return Bessel functions of x of the second kind of orders 0 and 1, respectively.

### Examples

j_0 j_1 jn y_1 yn

## y_1

y_1(x)

### Description

The y_0() and y_1() functions return Bessel functions of x of the second kind of orders 0 and 1, respectively.

### Examples

j_0 j_1 jn y_0 yn

## year

### Synopsis

year(serial_number)

### Description

Converts a serial number to a year.

### Examples

day month time now

## yn

yn(n, x)

### Description

The yn() function returns the Bessel function of x of the second kind of order n.