# Function Reference

- abs
- acos
- acosh
- address
- and
- ash
- asin
- asinh
- atan
- atan2
- atan_2
- atanh
- avedev
- average
- averagea
- base64decode
- base64encode
- besseli
- besselj
- besselk
- bessely
- betadist
- betainv
- bin2dec
- bin2hex
- bin2oct
- binomdist
- cbrt
- cc_solv
- ceil
- ceiling
- char
- chidist
- chiinv
- choose
- code
- columns
- combin
- complex
- concatenate
- confidence
- convert
- cos
- cosh
- count
- counta
- countblank
- countif
- critbinom
- crypt
- currency_rate
- datevalue
- daverage
- day
- dcount
- dcounta
- dec2bin
- dec2hex
- dec2oct
- define
- degrees
- delta
- devsq
- dget
- dmax
- dmin
- dollar
- dproduct
- drem
- dstdev
- dstdevp
- dsum
- duration
- dvar
- dvarp
- effect
- erf
- erfc
- euro
- even
- exact
- exp
- expm_1
- expondist
- fabs
- fact
- factdouble
- fdist
- finv
- fisher
- fisherinv
- fixed
- floor
- fmod
- fv
- g_product
- gammadist
- gammainv
- gammaln
- gcd
- geomean
- gestep
- get_cell
- getcwd
- getenv
- getgid
- gethostid
- gethostname
- getpgrp
- getpid
- getppid
- getuid
- hex2bin
- hex2dec
- hex2oct
- hlookup
- hour
- href
- hyperlink
- hypgeomdist
- hypot
- imabs
- imaginary
- imargument
- imconjugate
- imcos
- imdiv
- imexp
- imln
- imlog_10
- imlog_2
- impower
- improduct
- imreal
- imsin
- imsqrt
- imsub
- imsum
- imtan
- inet_addr
- info
- int
- isblank
- iseven
- islogical
- isna
- isnontext
- isnumber
- isodd
- ispmt
- istext
- j_0
- j_1
- jn
- kurt
- kurtp
- large
- lcm
- left
- len
- length
- lgamma
- ln
- log
- log1p
- log_10
- log_2
- loginv
- lognormdist
- lower
- max
- maxa
- median
- min
- mina
- minute
- mmult
- mod
- month
- mpf_abs
- mpf_add
- mpf_ceil
- mpf_cmp
- mpf_div
- mpf_div_2exp
- mpf_eq
- mpf_floor
- mpf_mul
- mpf_mul_2exp
- mpf_neg
- mpf_pow_ui
- mpf_reldiff
- mpf_sgn
- mpf_sqrt
- mpf_sub
- mpf_trunc
- mpz_abs
- mpz_add
- mpz_and
- mpz_bin_ui
- mpz_cdiv_q
- mpz_cdiv_r
- mpz_clrbit
- mpz_cmp
- mpz_cmpabs
- mpz_com
- mpz_divexact
- mpz_fac_ui
- mpz_fdiv_q
- mpz_fdiv_q_2exp
- mpz_fdiv_r
- mpz_fdiv_r_2exp
- mpz_fib_ui
- mpz_gcd
- mpz_hamdist
- mpz_invert
- mpz_ior
- mpz_jacobi
- mpz_lcm
- mpz_legendre
- mpz_mod
- mpz_mul
- mpz_mul_2exp
- mpz_neg
- mpz_nextprime
- mpz_perfect_power_p
- mpz_perfect_square_p
- mpz_popcount
- mpz_pow_ui
- mpz_powm
- mpz_probab_prime_p
- mpz_remove
- mpz_root
- mpz_scan0
- mpz_scan1
- mpz_setbit
- mpz_sgn
- mpz_sizeinbase
- mpz_sqrt
- mpz_sub
- mpz_tdiv_q
- mpz_tdiv_q_2exp
- mpz_tdiv_r
- mpz_tdiv_r_2exp
- mpz_tstbit
- mpz_xor
- mround
- n
- negbinomdist
- nominal
- normdist
- norminv
- normsdist
- normsinv
- not
- now
- nper
- oct2bin
- oct2dec
- oct2hex
- odd
- or
- permut
- pi
- pmt
- poisson
- pow
- pow_10
- pow_2
- power
- ppmt
- product
- pv
- pwr
- quotient
- r_avg
- r_max
- r_min
- r_sum
- radians
- rand
- randbernoulli
- randbetween
- randbinom
- randexp
- randnegbinom
- random
- randpoisson
- realtime
- rept
- roman
- round
- rounddown
- roundup
- rows
- second
- siag_colsum
- siag_rowsum
- sign
- sin
- sinh
- siod
- skew
- skewp
- sln
- small
- sqrt
- sqrtpi
- standardize
- stdev
- stdeva
- stdevp
- stdevpa
- stock_max
- stock_min
- stock_open
- stock_percent
- stock_price
- stock_var
- stock_volume
- stock_yesterday
- strcmp
- strcspn
- strspn
- substring
- sum
- suma
- sumif
- sumproduct
- sumsq
- sumx2my2
- sumx2py2
- sumxmy_2
- sxhash
- syd
- tan
- tanh
- tbilleq
- tbillprice
- tbillyield
- tdist
- time
- timevalue
- tinv
- totalheight
- totalwidth
- transpose
- trunc
- upper
- var
- vara
- varp
- varpa
- vref
- weekday
- weibull
- y_0
- y_1
- year
- yn

## abs

### Synopsis

abs(x)

### Description

Returns the absolute numerical value of x.

### Examples

abs(-3.14) returns 3.14.

### See Also

fabs

Top

## acos

### Synopsis

acos(x)

### Description

Returns the inverse cosine of x.

### Examples

### See Also

cos

Top

## acosh

### Synopsis

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.

### See Also

acos asinh degrees radians

Top

## address

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

### Examples

### See Also

Top

## and

### Synopsis

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.

### See Also

or not

Top

## ash

### Synopsis

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.

### See Also

Top

## asin

### Synopsis

asin(x)

### Description

Returns the inverse sin of x.

### Examples

### See Also

sin

Top

## asinh

### Synopsis

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.

### See Also

asin acosh sin cos degrees radians

Top

## atan

### Synopsis

atan(x)

### Description

Returns the inverse tangent of x.

### Examples

### See Also

tan

Top

## atan2

### Synopsis

atan2(x, y)

### Description

Returns the inverse tangent of x/y.

### Examples

### See Also

tan atan atan_2

Top

## atan_2

### Synopsis

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.

### Examples

### See Also

tan atan

Top

## atanh

### Synopsis

atanh(x)

### Description

ATANH function calculates the inverse hyperbolic tangent of x; that is the value whose hyperbolic tangent is x. If the absolute value of x is greater than 1.0, ATANH returns NUM! error. This function is Excel compatible.

### Examples

ATANH(0.5) equals 0.549306.

ATANH(0.8) equals 1.098612.

### See Also

atan tan sin cos degrees radians

Top

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

### See Also

stdev

Top

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

### See Also

sum count

Top

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

### See Also

average

Top

## base64decode

### Synopsis

base64decode(x)

### Description

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

### Examples

### See Also

base64encode

Top

## base64encode

### Synopsis

base64encode(x)

### Description

Returns a string computed using the base64 encoding algorithm.

### Examples

### See Also

base64decode

Top

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

### See Also

besselj besselk bessely

Top

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

### See Also

besselj besselk bessely

Top

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

### See Also

besseli besselj bessely

Top

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

### See Also

besseli besselj besselk

Top

## betadist

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

### Examples

betadist(0.12,2,3) equals 0.07319808.

### See Also

betainv

Top

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

### See Also

betadist

Top

## bin2dec

### Synopsis

bin2dec(x)

### Description

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

### Examples

bin2dec(101) equals 5.

### See Also

dec2bin bin2oct bin2hex

Top

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

### See Also

hex2bin bin2oct bin2dec

Top

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

### See Also

oct2bin bin2dec bin2hex

Top

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

### See Also

poisson

Top

## cbrt

### Synopsis

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.

### Examples

### See Also

sqrt pow

Top

## cc_solv

### Synopsis

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

### Examples

### See Also

Top

## ceil

### Synopsis

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.

### See Also

abs floor int

Top

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

### See Also

ceil

Top

## char

### Synopsis

char(x)

### Description

Char returns the ASCII character represented by the number x.

### Examples

char(65) equals A.

### See Also

code

Top

## chidist

### Synopsis

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.

### See Also

chiinv chitest

Top

## chiinv

### Synopsis

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.

### See Also

chidist chitest

Top

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

### Examples

### See Also

if

Top

## code

### Synopsis

code(char)

### Description

Code returns the ASCII number for the character char.

### Examples

code("A") equals 65.

### See Also

char

Top

## columns

### Synopsis

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.

### Examples

### See Also

column row rows

Top

## combin

### Synopsis

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.

### See Also

Top

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

### See Also

Top

## concatenate

### Synopsis

concatenate(string1[, string2...])

### Description

Concatenate returns up appended strings.

### Examples

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

### See Also

left mid right

Top

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

### See Also

average

Top

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

### See Also

Top

## cos

### Synopsis

cos(x)

### Description

Returns the cosine where x is in units of radians.

### Examples

### See Also

sin

Top

## cosh

### Synopsis

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.

### See Also

cos sin sinh tan tanh radians degrees exp

Top

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

### See Also

average

Top

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

### See Also

average count dcount dcounta product sum

Top

## countblank

### Synopsis

countblank(range)

### Description

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

### Examples

### See Also

count

Top

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

### See Also

count sumif

Top

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

### See Also

binomdist

Top

## crypt

### Synopsis

crypt(key, salt)

### Description

A form of string hash.

### Examples

### See Also

Top

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

### See Also

stock_price euro

Top

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

### Examples

### See Also

date

Top

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

### See Also

dcount

Top

## day

### Synopsis

day(serial_number)

### Description

Converts a serial number to a day.

### Examples

### See Also

month time now year

Top

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

### See Also

daverage

Top

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

### See Also

dcount

Top

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

### See Also

bin2dec dec2oct dec2hex

Top

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

### See Also

hex2dec dec2bin dec2oct

Top

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

### See Also

oct2dec dec2bin dec2hex

Top

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

### See Also

Top

## degrees

### Synopsis

degrees(x)

### Description

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

### Examples

degrees(2.5) equals 143.2394.

### See Also

radians pi

Top

## delta

### Synopsis

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.

### See Also

exact gestep

Top

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

### See Also

stdev

Top

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

### See Also

dcount

Top

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

### See Also

dmin

Top

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

### See Also

dmax

Top

## dollar

### Synopsis

dollar(num[,decimals])

### Description

Dollar returns num formatted as currency.

### Examples

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

### See Also

fixed text value

Top

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

### See Also

dsum

Top

## drem

### Synopsis

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.

### Examples

### See Also

fmod

Top

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

### See Also

dstdevp

Top

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

### See Also

dstdev

Top

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

### See Also

dproduct

Top

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

### Examples

### See Also

ppmt pv fv

Top

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

### See Also

dvarp

Top

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

### See Also

dvar

Top

## effect

### Synopsis

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.

### See Also

nominal

Top

## erf

### Synopsis

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.

### See Also

erfc

Top

## erfc

### Synopsis

erfc(x)

### Description

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

### Examples

### See Also

erf

Top

## euro

### Synopsis

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.

### See Also

currency_rate

Top

## even

### Synopsis

even(number)

### Description

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

### Examples

even(5.4) equals 6.

### See Also

odd

Top

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

### See Also

len

Top

## exp

### Synopsis

exp(x)

### Description

Computes the exponential function of x.

### Examples

### See Also

Top

## expm_1

### Synopsis

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.

### Examples

### See Also

exp log

Top

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

### See Also

poisson

Top

## fabs

### Synopsis

fabs(x)

### Description

FABS returns the absolute value of the number x.

### Examples

fabs(1) equals 1.

fabs(-3.14) equals 3.14.

### See Also

abs

Top

## fact

### Synopsis

fact(x)

### Description

Fact computes the factorial of x. ie, x! This function is Excel compatible.

### Examples

fact(3) equals 6.

fact(9) equals 362880.

### See Also

Top

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

### See Also

fact

Top

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

### See Also

finv

Top

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

### See Also

fdist

Top

## fisher

### Synopsis

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.

### See Also

skew

Top

## fisherinv

### Synopsis

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.

### See Also

fisher

Top

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

### See Also

Top

## floor

### Synopsis

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.

### See Also

ceil

Top

## fmod

### Synopsis

fmod(x)

### Description

Floating point mod.

### Examples

### See Also

Top

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

### Examples

### See Also

pv pmt ppmt

Top

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

### See Also

sum count

Top

## gammadist

### Synopsis

gammadist(x,alpha,beta,cum)

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

### Examples

GAMMADIST(1,2,3,0) equals 0.07961459.

### See Also

gammainv

Top

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

### See Also

gammadist

Top

## gammaln

### Synopsis

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.

### See Also

poisson

Top

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

### See Also

lcm

Top

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

### See Also

average harmean median mode trimmean

Top

## gestep

### Synopsis

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.

### See Also

delta

Top

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

### See Also

href vref

Top

## getcwd

### Synopsis

getcwd()

### Description

Returns the current working directory.

### Examples

### See Also

Top

## getenv

### Synopsis

getenv(name)

### Description

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

### Examples

### See Also

Top

## getgid

### Synopsis

getgid()

### Description

Returns the group id of the process.

### Examples

### See Also

Top

## gethostid

### Synopsis

gethostid()

### Description

Returns a 32 bit number.

### Examples

### See Also

Top

## gethostname

### Synopsis

gethostname()

### Description

Returns the configured name of the host.

### Examples

### See Also

Top

## getpgrp

### Synopsis

getpgrp()

### Description

Returns the process group ID of the calling process.

### Examples

### See Also

Top

## getpid

### Synopsis

getpid()

### Description

Returns the process ID of the calling process.

### Examples

### See Also

Top

## getppid

### Synopsis

getppid()

### Description

Returns the parent process ID of the calling process.

### Examples

### See Also

Top

## getuid

### Synopsis

getuid()

### Description

Returns the uid of the current process.

### Examples

### See Also

Top

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

### See Also

bin2hex hex2oct hex2dec

Top

## hex2dec

### Synopsis

hex2dec(x)

### Description

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

### Examples

HEX2DEC("2A") equals 42.

### See Also

dec2hex hex2bin hex2oct

Top

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

### See Also

oct2hex hex2bin hex2dec

Top

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

### Examples

### See Also

vlookup

Top

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

### See Also

minute now time second

Top

## href

### Synopsis

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.

### See Also

vref

Top

## hyperlink

### Synopsis

hyperlink(reference)

### Description

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

### Examples

### See Also

Top

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

### See Also

binomdist poisson

Top

## hypot

### Synopsis

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.

### Examples

### See Also

sqrt

Top

## imabs

### Synopsis

imabs(inumber)

### Description

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

### Examples

IMABS("2-j") equals 2.23606798.

### See Also

imaginary imreal

Top

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

### See Also

imreal

Top

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

### See Also

Top

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

### See Also

imaginary imreal

Top

## imcos

### Synopsis

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.

### See Also

imsin imtan

Top

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

### See Also

improduct

Top

## imexp

### Synopsis

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.

### See Also

imln

Top

## imln

### Synopsis

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.

### See Also

imexp imlog2 imlog10

Top

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

### See Also

imln imlog_2

Top

## imlog_2

### Synopsis

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.

### See Also

imln imlog_10

Top

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

### See Also

imsqrt

Top

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

### See Also

imdiv

Top

## imreal

### Synopsis

imreal(inumber)

### Description

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

### Examples

imreal("132-j") equals 132.

### See Also

imaginary

Top

## imsin

### Synopsis

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.

### See Also

imcos imtan

Top

## imsqrt

### Synopsis

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.

### See Also

impower

Top

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

### See Also

imsum

Top

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

### See Also

imsub

Top

## imtan

### Synopsis

imtan(inumber)

### Description

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

### Examples

### See Also

imsin imcos

Top

## inet_addr

### Synopsis

inet_addr(str)

### Description

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

### Examples

### See Also

Top

## info

### Synopsis

info()

### Description

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

### Examples

### See Also

Top

## int

### Synopsis

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.

### See Also

floor ceil abs

Top

## isblank

### Synopsis

isblank(exp)

### Description

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

### Examples

### See Also

Top

## iseven

### Synopsis

iseven(x)

### Description

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

### Examples

### See Also

isodd

Top

## islogical

### Synopsis

islogical(x)

### Description

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

### Examples

### See Also

Top

## isna

### Synopsis

isna(x)

### Description

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

### Examples

### See Also

Top

## isnontext

### Synopsis

isnontext(x)

### Description

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

### Examples

### See Also

istext

Top

## isnumber

### Synopsis

isnumber(x)

### Description

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

### Examples

### See Also

Top

## isodd

### Synopsis

isodd()

### Description

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

### Examples

### See Also

iseven

Top

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

### Examples

### See Also

pv

Top

## istext

### Synopsis

istext()

### Description

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

### Examples

### See Also

isnontext

Top

## j_0

### Synopsis

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

### See Also

j_1 jn y_0 y_1 yn

Top

## j_1

### Synopsis

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

### See Also

j_0 jn y_0 y_1 yn

Top

## jn

### Synopsis

jn(n, x)

### Description

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

### Examples

### See Also

j_0 j_1 y_0 y_1 yn

Top

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

### See Also

average var skew kurtp

Top

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

### See Also

average varp skewp kurt

Top

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

### See Also

percentile percentrank quartile small

Top

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

### See Also

gcd

Top

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

### See Also

mid right

Top

## len

### Synopsis

len(string)

### Description

LEN returns the length in characters of the string string.

### Examples

len("Helsinki") equals 8.

### See Also

char code

Top

## length

### Synopsis

length()

### Description

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

### Examples

### See Also

Top

## lgamma

### Synopsis

lgamma(x)

### Description

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

### Examples

### See Also

infnan

Top

## ln

### Synopsis

ln(x)

### Description

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

### Examples

LN(7) equals 1.94591.

### See Also

exp log_2 log_10

Top

## log

### Synopsis

log(x)

### Description

Computes the natural logarithm of x.

### Examples

### See Also

Top

## log1p

### Synopsis

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.

### Examples

### See Also

exp log

Top

## log_10

### Synopsis

log_10(x)

### Description

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

### Examples

### See Also

log

Top

## log_2

### Synopsis

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.

### See Also

exp log_10 log

Top

## loginv

### Synopsis

loginv(p,mean,stdev)

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

LOGINV(0.5,2,3) equals 7.389056099.

### See Also

exp ln log log10 lognormdist

Top

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

### See Also

normdist

Top

## lower

### Synopsis

lower(text)

### Description

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

### Examples

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

### See Also

upper

Top

## max

### Synopsis

max(x1, x2, ...)

### Description

Returns the maximum of x1, x2, etc.

### Examples

### See Also

r_max

Top

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

### See Also

max mina

Top

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

### See Also

average count counta daverage mode sum

Top

## min

### Synopsis

min(x1, x2, ...)

### Description

Returns the numerical minimum of its arguments.

### Examples

### See Also

r_min

Top

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

### See Also

min maxa

Top

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

### See Also

hour now time second

Top

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

### See Also

transpose minverse

Top

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

### See Also

int floor ceil

Top

## month

### Synopsis

month(serial_number)

### Description

Converts a serial number to a month.

### Examples

### See Also

day time now year

Top

## mpf_abs

### Synopsis

mpf_abs(op)

### Description

Set ROP to the absolute value of OP.

### Examples

### See Also

Top

## mpf_add

### Synopsis

mpf_add(op1, op2)

### Description

Set ROP to OP1 + OP2.

### Examples

### See Also

Top

## mpf_ceil

### Synopsis

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

### See Also

mpf_floor mpf_trunc

Top

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

### Examples

### See Also

Top

## mpf_div

### Synopsis

mpf_div(op1, op2)

### Description

Set ROP to OP1/OP2.

### Examples

### See Also

Top

## mpf_div_2exp

### Synopsis

mpf_div_2exp(op1, op2)

### Description

Set ROP to OP1 divided by 2 raised to OP2.

### Examples

### See Also

Top

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

### Examples

### See Also

Top

## mpf_floor

### Synopsis

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

### See Also

mpf_ceil mpf_trunc

Top

## mpf_mul

### Synopsis

mpf_mul(op1, op2)

### Description

Set ROP to OP1 times OP2.

### Examples

### See Also

Top

## mpf_mul_2exp

### Synopsis

mpf_mul_2exp(op1, op2)

### Description

Set ROP to OP1 times 2 raised to OP2.

### Examples

### See Also

Top

## mpf_neg

### Synopsis

mpf_neg(op)

### Description

Set ROP to -OP.

### Examples

### See Also

Top

## mpf_pow_ui

### Synopsis

mpf_pow_ui(op1, op2)

### Description

Set ROP to OP1 raised to the power OP2.

### Examples

### See Also

Top

## mpf_reldiff

### Synopsis

mpf_reldiff(op1, op2)

### Description

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

### Examples

### See Also

Top

## mpf_sgn

### Synopsis

mpf_sgn(op)

### Description

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

### Examples

### See Also

Top

## mpf_sqrt

### Synopsis

mpf_sqrt(op)

### Description

Set ROP to the square root of OP.

### Examples

### See Also

Top

## mpf_sub

### Synopsis

mpf_sub(op1, op2)

### Description

Set ROP to OP1 - OP2.

### Examples

### See Also

Top

## mpf_trunc

### Synopsis

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

### See Also

mpf_floor mpf_ceil

Top

## mpz_abs

### Synopsis

mpz_abs(op)

### Description

Set ROP to the absolute value of OP.

### Examples

### See Also

Top

## mpz_add

### Synopsis

mpz_add(a, b)

### Description

Computes a+b for integers of arbitrary size.

### Examples

### See Also

Top

## mpz_and

### Synopsis

mpz_and(op1, op2)

### Description

Set ROP to OP1 logical-and OP2.

### Examples

### See Also

Top

## mpz_bin_ui

### Synopsis

mpz_bin_ui(n, k)

### Description

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

### Examples

### See Also

Top

## mpz_cdiv_q

### Synopsis

mpz_cdiv_q(n, d)

### Description

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

### Examples

### See Also

Top

## mpz_cdiv_r

### Synopsis

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.

### Examples

### See Also

Top

## mpz_clrbit

### Synopsis

mpz_clrbit(rop, bit_index)

### Description

Clear bit BIT_INDEX in ROP.

### Examples

### See Also

Top

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

### Examples

### See Also

Top

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

### Examples

### See Also

Top

## mpz_com

### Synopsis

mpz_com(op)

### Description

Set ROP to the one's complement of OP.

### Examples

### See Also

Top

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

### Examples

### See Also

Top

## mpz_fac_ui

### Synopsis

mpz_fac_ui(op)

### Description

Set ROP to OP!, the factorial of OP.

### Examples

### See Also

Top

## mpz_fdiv_q

### Synopsis

mpz_fdiv_q(n, d)

### Description

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

### Examples

### See Also

Top

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

### Examples

### See Also

Top

## mpz_fdiv_r

### Synopsis

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.

### Examples

### See Also

Top

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

### Examples

### See Also

Top

## mpz_fib_ui

### Synopsis

mpz_fib_ui(n)

### Description

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

### Examples

### See Also

Top

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

### Examples

### See Also

Top

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

### Examples

### See Also

Top

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

### Examples

### See Also

Top

## mpz_ior

### Synopsis

mpz_ior(op1, op2)

### Description

Set ROP to OP1 inclusive-or OP2.

### Examples

### See Also

Top

## mpz_jacobi

### Synopsis

mpz_jacobi(op1, op2)

### Description

Compute the Jacobi and Legendre symbols, respectively.

### Examples

### See Also

mpz_legendre

Top

## mpz_lcm

### Synopsis

mpz_lcm(op1, op2)

### Description

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

### Examples

### See Also

Top

## mpz_legendre

### Synopsis

mpz_legendre(op1, op2)

### Description

Compute the Jacobi and Legendre symbols, respectively.

### Examples

### See Also

mpz_jacobi

Top

## mpz_mod

### Synopsis

mpz_mod(n, d)

### Description

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

### Examples

### See Also

Top

## mpz_mul

### Synopsis

mpz_mul(a, b)

### Description

Computes a*b for integers of arbitrary size.

### Examples

### See Also

Top

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

### Examples

### See Also

Top

## mpz_neg

### Synopsis

mpz_neg(op)

### Description

Set ROP to -OP.

### Examples

### See Also

Top

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

### Examples

### See Also

Top

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

### Examples

### See Also

Top

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

### Examples

### See Also

Top

## mpz_popcount

### Synopsis

mpz_popcount(op)

### Description

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

### Examples

### See Also

Top

## mpz_pow_ui

### Synopsis

mpz_pow_ui(base, exp)

### Description

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

### Examples

### See Also

Top

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

### Examples

### See Also

Top

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

### Examples

### See Also

Top

## mpz_remove

### Synopsis

mpz_remove(op, f)

### Description

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

### Examples

### See Also

Top

## mpz_root

### Synopsis

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.

### Examples

### See Also

Top

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

### Examples

### See Also

Top

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

### Examples

### See Also

Top

## mpz_setbit

### Synopsis

mpz_setbit(rop, bit_index)

### Description

Set bit BIT_INDEX in ROP.

### Examples

### See Also

Top

## mpz_sgn

### Synopsis

mpz_sgn(op)

### Description

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

### Examples

### See Also

Top

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

### Examples

### See Also

Top

## mpz_sqrt

### Synopsis

mpz_sqrt(op)

### Description

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

### Examples

### See Also

Top

## mpz_sub

### Synopsis

mpz_sub(a, b)

### Description

Computes a-b for integers of arbitrary size.

### Examples

### See Also

Top

## mpz_tdiv_q

### Synopsis

mpz_tdiv_q(n, d)

### Description

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

### Examples

### See Also

Top

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

### Examples

### See Also

Top

## mpz_tdiv_r

### Synopsis

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.

### Examples

### See Also

Top

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

### Examples

### See Also

Top

## mpz_tstbit

### Synopsis

mpz_tstbit(op, bit_index)

### Description

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

### Examples

### See Also

Top

## mpz_xor

### Synopsis

mpz_xor(op1, op2)

### Description

Set ROP to OP1 exclusive-or OP2.

### Examples

### See Also

Top

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

### See Also

rounddown round roundup

Top

## n

### Synopsis

n(x)

### Description

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

### Examples

### See Also

Top

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

### See Also

binomdist combin fact hypgeomdist permut

Top

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

### Examples

### See Also

effect

Top

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

### See Also

poisson

Top

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

### See Also

normdist normsdist normsinv standardize ztest

Top

## normsdist

### Synopsis

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.

### See Also

normdist

Top

## normsinv

### Synopsis

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.

### See Also

normdist norminv normsdist standardize ztest

Top

## not

### Synopsis

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.

### See Also

and or

Top

## now

### Synopsis

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.

### Examples

### See Also

today now

Top

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

### See Also

ppmt pv fv

Top

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

### See Also

bin2oct oct2dec oct2hex

Top

## oct2dec

### Synopsis

oct2dec(x)

### Description

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

### Examples

OCT2DEC("124") equals 84.

### See Also

dec2oct oct2bin oct2hex

Top

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

### See Also

hex2oct oct2bin oct2dec

Top

## odd

### Synopsis

odd(number)

### Description

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

### Examples

ODD(4.4) equals 5.

### See Also

even

Top

## or

### Synopsis

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.

### See Also

and not

Top

## permut

### Synopsis

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.

### See Also

combin

Top

## pi

### Synopsis

pi()

### Description

PI functions returns the value of Pi.

This function is called with no arguments. Excel compatible.

### Examples

PI() equals 3.141593.

### See Also

sqrtpi

Top

## pmt

### Synopsis

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

### Description

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

### Examples

### See Also

ppmt pv fv

Top

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

### See Also

normdist weibull

Top

## pow

### Synopsis

pow(x, y)

### Description

Computes the result of x raised to the y power.

### Examples

### See Also

Top

## pow_10

### Synopsis

pow_10(x)

### Description

### Examples

### See Also

Top

## pow_2

### Synopsis

pow_2(x)

### Description

### Examples

### See Also

Top

## power

### Synopsis

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.

### See Also

exp

Top

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

### Examples

### See Also

ipmt pv fv

Top

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

### See Also

sum count g_product

Top

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

### Examples

### See Also

fv

Top

## pwr

### Synopsis

pwr(y, n)

### Description

Compute an integral power of a double precision number.

### Examples

### See Also

Top

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

### See Also

mod

Top

## r_avg

### Synopsis

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.

### See Also

r_max r_min r_sum

Top

## r_max

### Synopsis

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.

### See Also

r_sum r_min r_avg

Top

## r_min

### Synopsis

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.

### See Also

r_max r_sum r_avg

Top

## r_sum

### Synopsis

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.

### See Also

r_max r_min r_avg

Top

## radians

### Synopsis

radians(x)

### Description

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

### Examples

RADIANS(180) equals 3.14159.

### See Also

pi degrees

Top

## rand

### Synopsis

rand(modulus)

### Description

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

### Examples

### See Also

random

Top

## randbernoulli

### Synopsis

randbernoulli(p)

### Description

RandBernoulli returns a Bernoulli distributed random number.

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

### Examples

RandBernoulli(0.5).

### See Also

rand randbetween

Top

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

### See Also

rand

Top

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

### See Also

rand randbetween

Top

## randexp

### Synopsis

randexp(b)

### Description

RandExp returns a exponentially distributed random number.

### Examples

RandExp(0.5).

### See Also

rand randbetween

Top

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

### See Also

rand randbetween

Top

## random

### Synopsis

random(modulus)

### Description

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

### Examples

### See Also

rand

Top

## randpoisson

### Synopsis

randpoisson(lambda)

### Description

RandPoisson returns a poisson distributed random number.

### Examples

RandPoisson(3).

### See Also

rand randbetween

Top

## realtime

### Synopsis

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.

### Examples

### See Also

Top

## rept

### Synopsis

rept(string,num)

### Description

REPT returns num repetitions of string.

### Examples

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

### See Also

concatenate

Top

## roman

### Synopsis

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.

### Examples

### See Also

Top

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

### See Also

rounddown roundup

Top

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

### See Also

round roundup

Top

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

### See Also

round rounddown

Top

## rows

### Synopsis

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.

### Examples

### See Also

column row rows

Top

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

### See Also

hour minute now time

Top

## siag_colsum

### Synopsis

siag_colsum(c1, c2)

### Description

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

### Examples

### See Also

siag_rowsum

Top

## siag_rowsum

### Synopsis

siag_rowsum(r1, r2)

### Description

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

### Examples

### See Also

siag_colsum

Top

## sign

### Synopsis

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.

### See Also

Top

## sin

### Synopsis

sin(x)

### Description

Computes the sine function of the angle x in radians.

### Examples

### See Also

cos

Top

## sinh

### Synopsis

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.

### See Also

sin cos cosh tan tanh degrees radians exp

Top

## siod

### Synopsis

siod()

### Description

Many functions are only available by using the SIOD interface.

### Examples

### See Also

Top

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

### See Also

average var skewp kurt

Top

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

### See Also

average varp skew kurtp

Top

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

### See Also

syd

Top

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

### See Also

percentile percentrank quartile large

Top

## sqrt

### Synopsis

sqrt(x)

### Description

Compute the square root of x.

### Examples

### See Also

pow pow2

Top

## sqrtpi

### Synopsis

sqrtpi(number)

### Description

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

### Examples

SQRTPI(2) equals 2.506628275.

### See Also

pi

Top

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

### See Also

average

Top

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

### See Also

average dstdev dstdevp stdeva stdevpa var

Top

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

### See Also

stdev stdevpa

Top

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

### See Also

stdev stdeva stdevpa

Top

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

### See Also

stdeva stdevp

Top

## stock_max

### Synopsis

stock_max(symbol)

### Description

Fetches stock information from Yahoo over the Internet.

### Examples

stock_max("ABB.ST")

### See Also

stock_yesterday stock_open stock_min stock_price stock_var stock_percent stock_volume

Top

## stock_min

### Synopsis

stock_min(symbol)

### Description

Fetches stock information from Yahoo over the Internet.

### Examples

stock_min("ABB.ST")

### See Also

stock_yesterday stock_open stock_price stock_max stock_var stock_percent stock_volume

Top

## stock_open

### Synopsis

stock_open(symbol)

### Description

Fetches stock information from Yahoo over the Internet.

### Examples

stock_open("ABB.ST")

### See Also

stock_yesterday stock_price stock_min stock_max stock_var stock_percent stock_volume

Top

## stock_percent

### Synopsis

stock_percent(symbol)

### Description

Fetches stock information from Yahoo over the Internet.

### Examples

stock_percent("ABB.ST")

### See Also

stock_yesterday stock_open stock_min stock_max stock_var stock_price stock_volume

Top

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

### See Also

stock_yesterday stock_open stock_min stock_max stock_var stock_percent stock_volume

Top

## stock_var

### Synopsis

stock_var(symbol)

### Description

Fetches stock information from Yahoo over the Internet.

### Examples

stock_var("ABB.ST")

### See Also

stock_yesterday stock_open stock_min stock_max stock_price stock_percent stock_volume

Top

## stock_volume

### Synopsis

stock_volume(symbol)

### Description

Fetches stock information from Yahoo over the Internet.

### Examples

stock_price("ABB.ST")

### See Also

stock_yesterday stock_open stock_min stock_max stock_var stock_percent stock_price

Top

## stock_yesterday

### Synopsis

stock_yesterday(symbol)

### Description

Fetches stock information from Yahoo over the Internet.

### Examples

stock_yesterday("ABB.ST")

### See Also

stock_price stock_open stock_min stock_max stock_var stock_percent stock_volume

Top

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

### Examples

### See Also

Top

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

### Examples

### See Also

Top

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

### Examples

### See Also

Top

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

### Examples

### See Also

Top

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

### See Also

average count

Top

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

### See Also

average sum count

Top

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

### See Also

countif sum

Top

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

### See Also

sum product

Top

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

### See Also

sum count

Top

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

### See Also

sumsq sumx2py2

Top

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

### See Also

sumsq sumx2my2

Top

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

### See Also

sumsq sumx2my2 sumx2py2

Top

## sxhash

### Synopsis

sxhash(data, modulus)

### Description

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

### Examples

### See Also

Top

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

### See Also

sln

Top

## tan

### Synopsis

tan(x)

### Description

Computes the tagent of the angle x specified in radians.

### Examples

### See Also

atan

Top

## tanh

### Synopsis

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.

### See Also

tan sin sinh cos cosh degrees radians

Top

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

### See Also

tbillprice tbillyield

Top

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

### See Also

tbilleq tbillyield

Top

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

### See Also

tbilleq tbillprice

Top

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

### See Also

tinv ttest

Top

## time

### Synopsis

time(hours,minutes,seconds)

### Description

Returns a number representing the time of day.

### Examples

### See Also

hour

Top

## timevalue

### Synopsis

timevalue(timetext)

### Description

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

### Examples

### See Also

hour

Top

## tinv

### Synopsis

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.

### See Also

tdist ttest

Top

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

### See Also

totalwidth

Top

## totalwidth

### Synopsis

totalwidth(c1, c2)

### Description

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

### Examples

totalwidth(3, 6)

### See Also

totalheight

Top

## transpose

### Synopsis

transpose(matrix)

### Description

TRANSPOSE returns the transpose of the input matrix.

### Examples

### See Also

mmult

Top

## trunc

### Synopsis

trunc(x)

### Description

Returns the integer portion of x.

### Examples

### See Also

floor ceil

Top

## upper

### Synopsis

upper(text)

### Description

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

### Examples

UPPER("canceled") equals "CANCELED".

### See Also

lower

Top

## var

### Synopsis

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.

### See Also

varp stdev

Top

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

### See Also

var varpa

Top

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

### See Also

average dvar dvarp stdev var

Top

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

### See Also

varp

Top

## vref

### Synopsis

vref(x)

### Description

Returns the contents from the cell x positions down.

### Examples

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

### See Also

href

Top

## weekday

### Synopsis

weekday(serial_number)

### Description

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

### Examples

### See Also

month time now year

Top

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

### See Also

poisson

Top

## y_0

### Synopsis

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

### See Also

j_0 j_1 jn y_1 yn

Top

## y_1

### Synopsis

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

### See Also

j_0 j_1 jn y_0 yn

Top

## year

### Synopsis

year(serial_number)

### Description

Converts a serial number to a year.

### Examples

### See Also

day month time now

Top

## yn

### Synopsis

yn(n, x)

### Description

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

### Examples

### See Also

j_0 j_1 jn y_0 y_1 yn

Top

Ulric Eriksson - November 2000 - ulric@siag.nu