Math SUBTOTAL Float Function Int Values FLOAT The SUBTOTAL() function returns a subtotal of a given list of arguments ignoring other subtotal results in there. Function can be one of the following numbers: 1 - Average, 2 - Count, 3 - CountA, 4 - Max, 5 - Min, 6 - Product, 7 - StDev, 8 - StDevP, 9 - Sum, 10 - Var, 11 - VarP. SUBTOTAL(function; value) If A1:A5 contains 7, 24, 23, 56 and 9: SUBTOTAL(1; A1:A5) returns 23.8 SUBTOTAL(4; A1:A5) returns 56 SUBTOTAL(9; A1:A5) returns 119 SUBTOTAL(11; A1:A5) returns 307.76 AVERAGE COUNT COUNTA MAX MIN PRODUCT STDEV STDEVP SUM VAR VARP LCM Float First number FLOAT Second number FLOAT The LCM() function returns the least common multiple for two or more float values LCM(value; value) LCM(6;4) returns 12 LCM(1.5;2.25) returns 4.5 LCM(2;3;4) returns 12 GCD GCD Int First number Int Second number Int Third number Int The GCD() function returns the greatest common denominator for two or more integer values. GCD(value; value) GCD(6;4) returns 2 GCD(10;20) returns 10 GCD(20;15;10) returns 5 LCM LCD Int First number Int Second number Int Third number Int The LCD() function returns the largest common denominator for two or more integer values. This function is obsolete and will be removed in a later version of KSpread. It is provided only for compatibility. Please use the GCD function instead. LCD(value; value) EPS Float EPS() returns the machine epsilon; this is the difference between 1 and the next largest floating-point number. Because computers use a finite number of digits, roundoff error is inherent (but usually insignificant) in all calculations. EPS() On most systems, this returns 2^-52=2.2204460492503131e-16 0.5*EPS() returns the "unit round"; this value is interesting because it is the largest number x where (1+x)-1=0 (due to roundoff errors). EPS() is so small that KSpread displays 1+eps() as 1 Pick a number x between 0 and EPS(). Observe that 1+x rounds x to either 0 or EPS() by using the equation (1+x)-1 POWER Float Floating point value Float Floating point value Float The POWER(x;y) function returns the value of x raised to the power of y. POWER(value;value) POWER(1.2;3.4) equals 1.8572 POWER(2;3) equals 8 POW POW Float Floating point value Float Floating point value Float The POW(x;y) function returns the value of x raised to the power of y. It's the same as POWER. POW(value;value) POW(1.2;3.4) equals 1.8572 POW(2;3) equals 8 POWER EVEN Float Floating point value Float The EVEN() function returns the number rounded up to the nearest even integer. EVEN(value) EVEN(1.2) returns 2 EVEN(2) returns 2 ODD TRUNC Float Floating point value Float Precision Integer The TRUNC() function truncates a numeric value to a certain precision. If the precision is omitted 0 is assumed. TRUNC(value; precision) TRUNC(1.2) returns 1 TRUNC(213.232; 2) returns 213.23 ROUND ROUNDDOWN ROUNDUP ODD Float Floating point value Float The ODD() function returns the number rounded up to the nearest odd integer. ODD(value) ODD(1.2) returns 3 ODD(2) returns 3 EVEN MOD Int Floating point value Int Floating point value Int The MOD() function returns the remainder after division. If the second parameter is null the function returns #DIV/0. MOD(value;value) MOD(12;5) returns 2 MOD(5;5) returns 0 DIV SIGN Int Floating point value Float This function returns -1 if the number is negative, 0 if the number is null and 1 if the number is positive. SIGN(value) SIGN(5) equals 1 SIGN(0) equals 0 SIGN(-5) equals -1 INV Float Floating point value Float This function multiplies each value by -1. INV(value) INV(-5) equals 5 INV(5) equals -5 INV(0) equals 0 COUNT Float Values FLOAT This function returns the count of integer or floating arguments passed. You can count using a range: COUNT(A1:B5) or using a list of values like COUNT(12;5;12.5). COUNT(value;value;value...) COUNT(-5;"KSpread";2) returns 2 COUNT(5) returns 1 COUNTA COUNTIF SUM COUNTA Float Values FLOAT This function returns the count of all non empty arguments passed. You can count using a range: COUNTA(A1:B5) or using a list of values like COUNTA(12;5;12.5). COUNTA(value;value;value...) COUNTA(-5;"KSpread";2) returns 3 COUNTA(5) returns 1 COUNT COUNTIF COUNTBLANK Float Cell range Range This function returns the count of all empty cells within the range. COUNTBLANK(range) COUNTBLANK(A1:B5) COUNT COUNTA COUNTIF COUNTIF Int Range Float Criteria String The COUNTIF() function returns the number of cells in the given range that meet the given criteria. COUNTIF(range;criteria) COUNTIF(A2:A3;"14") returns 1 if A1 is -4 and A2 is 14 COUNT SUMIF FACT Float A floating point value Float The FACT() function calculates the factorial of the parameter. The mathematical expression is (value)!. FACT(number) FACT(10) returns 3628800 FACT(0) returns 1 FACTDOUBLE Float A floating point value Float The FACTDOUBLE() function calculates the double factorial of a number, i.e. x!!. FACTDOUBLE(number) FACTDOUBLE(6) returns 48 FACTDOUBLE(7) returns 105 SUM Float Values FLOAT The SUM() function calculates the sum of all the values given as parameters. You can calculate the sum of a range SUM(A1:B5) or a list of values like SUM(12;5;12.5). SUM(value;value;...) SUM(12;5;7) equals 24 SUM(12.5;2) equals 14.5 SUMA SUMSQ SUMIF SUMA Float Values FLOAT The SUMA() function calculates the sum of all the values given as parameters. You can calculate the sum of a range SUMA(A1:B5) or a list of values like SUMA(12;5;12.5). If a parameter contains text or the boolean value FALSE it is counted as 0, if a parameter evaluates to TRUE it is counted as 1. SUM(value;value;...) SUMA(12;5; 7) equals 24 SUMA(12.5; 2; TRUE) equals 15.5 SUM SUMSQ SUMIF Float Check range Float Criteria String Sum range Float The SUMIF() function calculates the sum of all values given as parameters which match the criteria. The sum range is optional. If not supplied, the values in the check range are summed. The length of the check range should be equal or less than the length of the sum range. SUMIF(checkrange;criteria;sumrange) SUMIF(A1:A4;">1") sums all values in range A1:A4 which match >1 SUMIF(A1:A4;"=0";B1:B4) sums all values in range B1:B4 if the corresponding value in A1:A4 matches =0 SUM COUNTIF PRODUCT Float Values FLOAT The PRODUCT() function calculates the product of all the values given as parameters. You can calculate the product of a range: PRODUCT(A1:B5) or a list of values like product(12;5;12.5). If no numeric values are found 0 is returned. PRODUCT(value;value;...) PRODUCT(3;5;7) equals 105 PRODUCT(12.5;2) equals 25 MULTIPLY KPRODUCT KPRODUCT Float Values FLOAT The KPRODUCT() function calculates the product of all the values given as parameters. You can calculate the product of a range: KPRODUCT(A1:B5) or a list of values like KPRODUCT(12;5;12.5). If no numeric values are found 1 is returned. KPRODUCT(value;value;...) KPRODUCT(3;5;7) equals 105 KPRODUCT(12.5;2) equals 25 G_PRODUCT MULTIPLY PRODUCT G_PRODUCT Float Values FLOAT The G_PRODUCT() function is the same as KPRODUCT. It is provided for Gnumeric compatibility. G_PRODUCT(value;value;...) KPRODUCT DIV Float Values FLOAT The DIV() function divides the first value by the other values in turn. DIV(value;value;...) DIV(20;2;2) returns 5 DIV(25;2.5) returns 10 MULTIPLY MOD SUMSQ Float Values FLOAT The SUMSQ() function calculates the sum of all the squares of values given as parameters. You can calculate the sum of a range SUMSQ(A1:B5) or a list of values like SUMSQ(12;5;12.5). SUMSQ(value;value;...) SUMSQ(12;5;7) equals 218 SUMSQ(12.5;2) equals 173 SUM MAX Float Values FLOAT The MAX() function returns the largest value given in the parameters. String and logical values are ignored. MAX(value;value;...) MAX(12;5; 7) returns 12 MAX(12.5; 2) returns 12.5 MAX(0.5; 0.4; TRUE; 0.2) returns 0.5 COUNT COUNTA MAXA MIN MINA MAXA Float Values FLOAT The MAXA() function returns the largest value given in the parameters. TRUE evaluates to 1, FALSE evaluates to 0. String values are ignored. MAXA(value;value;...) MAXA(12;5; 7) returns 12 MAXA(12.5; 2) returns 12.5 MAXA(0.5; 0.4; TRUE; 0.2) returns 1 COUNT COUNTA MAX MIN MINA MIN Float Values FLOAT The MIN() function returns the smallest value given in the parameters. String and logical values are ignored. MIN(value;value;...) MIN(12;5; 7) returns 5 MIN(12.5; 2) returns 2 MIN(0.4; 2; FALSE; 0.7) returns 0.4 COUNT COUNTA MAX MAXA MINA MINA Float Values FLOAT The MINA() function returns the smallest value given in the parameters. TRUE evaluates to 1, FALSE to 0. String values are ignored. MINA(value;value;...) MINA(12;5; 7) returns 5 MINA(12.5; 2) returns 2 MINA(0.4; 2; FALSE; 0.7) returns 0. COUNT COUNTA MAX MAXA MIN MULTIPLY Float Values FLOAT The MULTIPLY() function multiplies all the values given in the parameters. You can multiply values given by a range MULTIPLY(A1:B5) or a list of values like MULTIPLY(12;5;12.5). It's equivalent to PRODUCT. MULTIPLY(value;value;...) MULTIPLY(12;5;7) equals 420 MULTIPLY(12.5;2) equals 25 DIV PRODUCT KPRODUCT MULTINOMIAL Float Values FLOAT The MULTINOMIAL() function returns the multinomial of each number in the parameters. It uses this formula for MULTINOMIAL(a,b,c): (a+b+c)! / a!b!c! MULTINOMIAL(value;value;...) MULTINOMIAL(3;4;5) equals 27720 SQRT Float A floating point value Float The SQRT() function returns the non-negative square root of x. If x is negative, "NaN" is returned. SQRT(x) SQRT(9) equals 3 SQRT(-9) equals "NaN" SQRTPI Float A floating point value Float The SQRTPI() function returns the non-negative square root of x * PI. SQRTPI(x) SQRTPI(2) equals 2.506628 LN Float A floating point value Float The LN() function returns the natural logarithm of x. LN(x) LN(0.8) equals -0.22314355 LN(0) equals -inf LOG LOG10 LOG2 LOGN Float A floating point value Float Base Float The LOGn() function returns the base n logarithm of x. LOGn(value;base) LOGn(12;10) equals 1.07918125 LOGn(12;2) equals 3.5849625 LOG LN LOG10 LOG2 ROOTN Float A floating point value Float Value Int The ROOTN() function returns the non-negative nth root of x. ROOTN(x;n) ROOTN(9;2) equals 3 SQRT CUR Float A floating point value Float The CUR() function returns the non-negative cube root of x. CUR(x) CUR(27) equals 3 SQRT LOG Float A floating point value Float The LOG() function returns the base-10 logarithm of x. LOG(x) LOG(0.8) equals -0.09691001 LOG(0) equals -inf. LN LOGN LOG10 LOG2 LOG10 Float A floating point value Float The LOG10() function returns the base-10 logarithm of x. LOG10(x) LOG10(0.8) equals -0.09691001 LOG10(0) equals -inf. LN LOGN LOG LOG2 LOG2 Float A floating point value Float The LOG2() function returns the base-2 logarithm of x. LOG2(x) LOG2(0.8) equals -0.32192809 LOG2(0) equals -inf. LN LOGN LOG LOG10 EXP Float A floating point value Float The EXP() function returns the value of e (the base of natural logarithms) raised to the power of x. EXP(x) EXP(9) equals 8 103.08392758 EXP(-9) equals 0.00012341 LN CEIL Float A floating point value Float The CEIL() function rounds x up to the nearest integer, returning that value as a double. CEIL(x) CEIL(12.5) equals 13 CEIL(-12.5) equals -12 CEILING FLOOR CEILING Float A floating point value Float Significance (optional) Float The CEILING() function rounds x up to the nearest multiple of significance. CEILING(x) CEILING(12.5) equals 13 CEILING(6.43; 4) equals 8 CEIL FLOOR FLOOR Float A floating point value Float The FLOOR() function rounds x down to the nearest integer, returning that value as a double. FLOOR(x) FLOOR(12.5) equals 12 FLOOR(-12.5) equals -13 CEIL ABS Float A floating point value Float The ABS() function returns the absolute value of the floating-point number x. ABS(x) ABS(12.5) equals 12.5 ABS(-12.5) equals 12.5 INT Int A floating point value Float The INT() function returns the integer part of the value. INT(x) INT(12.55) equals 12 INT(15) equals 15 FLOOR QUOTIENT RAND Float The RAND() function returns a pseudo-random number between 0 and 1. RAND() RAND() equals for example 0.78309922... RANDBETWEEN RANDEXP RANDEXP Float A floating point value (greater 0) Float The RANDEXP() function returns an exponentially-distributed pseudo-random number. RANDEXP(x) RANDEXP(0.88) RAND RANDPOISSON Float A floating point value (greater 0) Float A floating point value Float The RANDPOISSON() function returns a poisson-distributed pseudo-random number. RANDPOISSON(x) RANDPOISSON(4) RAND RANDBINOM Float A floating point value (between 0 and 1) Float Trials (greater 0) Int The RANDBINOM() function returns a binomially-distributed pseudo-random number. RANDBINOM(x) RANDBINOM(4) RAND RANDNEGBINOM RANDNEGBINOM Float A floating point value (between 0 and 1) Float Failures (greater 0) Int The RANDNEGBINOM() function returns a negative binomially-distributed pseudo-random number. RANDNEGBINOM(x) RANDNEGBINOM(4) RAND RANDBINOM RANDBERNOULLI Float A floating point value (between 0 and 1) Float A floating point value Float The RANDBERNOULLI() function returns a Bernoulli-distributed pseudo-random number. RANDBERNOULLI(x) RANDBERNOULLI(0.45) RAND RANDNORM Float Mean value of the normal distribution Float Dispersion of the normal distribution Float The RANDNORM() function returns a Normal(Gaussian)-distributed pseudo-random number. RANDNORM(mu; sigma) RANDNORM(0; 1) RAND RANDBETWEEN Float Bottom value Int Top value Int The RANDBETWEEN() function returns a pseudo-random number between bottom and top value. If bottom > top this function returns Err. RANDBETWEEN(bottom;top) RANDBETWEEN(12;78) equals for example 61.0811... RAND MROUND Float Floating point value Float Multiple Float The MROUND() function returns the value rounded to the specified multiple. The value and the multiple must have the same sign MROUND(value; multiple) MROUND(1.252; 0.5) equals 1.5 MROUND(-1.252; -0.5) equals -1.5 ROUND ROUND Float Floating point value Float Digits Int The ROUND(value;[digits]) function returns value rounded. Digits is the number of digits to which you want to round that number. If digits is zero or omitted, value is rounded up to the nearest integer. If digits is smaller than zero, the corresponding integer part of the number is rounded. ROUND(value;[digits]) ROUND(1.252;2) equals 1.25 ROUND(-1.252;2) equals -1.25 ROUND(1.258;2) equals 1.26 ROUND(-12.25;-1) equals -10 ROUND(-1.252;0) equals -1 MROUND ROUNDDOWN ROUNDUP ROUNDUP Float Floating point value Float Digits Int The ROUNDUP(value;[digits]) function returns value rounded up. Digits is the number of digits to which you want to round that number. If digits is zero or omitted, value is rounded up to the nearest integer. ROUNDUP(value;[digits]) ROUNDUP(1.252;2) equals 1.26 ROUNDUP(-1.252;2) equals -1.25 ROUNDUP(-1.252) equals -1 ROUND ROUNDDOWN ROUNDDOWN Float Floating point value Float Digits Int The ROUNDDOWN(value;[digits]) function returns value rounded down. Digits is the number of digits to which you want to round that number. If digits is zero or omitted, value is rounded down to the nearest integer. ROUNDDOWN(value;[digits]) ROUNDDOWN(1.252;2) equals 1.25 ROUNDDOWN(-1.252;2) equals -1.26 ROUNDDOWN(-1.252) equals -2 ROUND ROUNDUP FIB Float Nth term Float Function FIB calculates the Nth term of a Fibonacci sequence (1, 1, 2, 3, 5, 8, 13, 21...), in which each number, after the first two, is the sum of the two numbers immediately preceding it. FIB(0) is defined to be 0. FIB(n) FIB(9) returns 34 FIB(26) returns 121393 QUOTIENT Int Numerator Float Denumerator Float Function QUOTIENT returns the integer portion of numerator/denumerator. QUOTIENT(numerator;denumerator) QUOTIENT(21;4) returns 5 INT MDETERM Float Range Float Function MDETERM returns the determinant of a given matrix. The matrix must be of type n x n. MDETERM(matrix) MDETERM(A1:C3) MMULT MMULT Float First matrix Float Second matrix Float Function MMULT multiplies two matrices. Number of columns of the first matrix nust be the same as row count of the second one. The result is a matrix. MMULT(matrix1;matrix2) MMULT(A1:C3) MDETERM