Difference between revisions of "FPSpreadsheet: List of formulas"
From Lazarus wiki
Jump to navigationJump to search (Add formulas CEILING and FLOOR) |
(Add a column on which file formats do not support the formula in the row) |
||
Line 9: | Line 9: | ||
! scope="col" | Arguments | ! scope="col" | Arguments | ||
! scope="col" | Result type | ! scope="col" | Result type | ||
+ | ! scope="col" | Not for | ||
|- | |- | ||
− | | style="background:blue; color:white;" colspan=" | + | | style="background:blue; color:white;" colspan="6" | <b>Mathematical functions</b> |
|- valign="top" | |- valign="top" | ||
− | | <code>ABS(num)</code> || Returns the absolute value of a number || float || align="center" |1 || align="center" | float | + | | <code>ABS(num)</code> || Returns the absolute value of a number || float || align="center" |1 || align="center" | float || |
|- valign="top" | |- valign="top" | ||
− | | <code>ACOS(num)</code> || Returns the arccosine (in radians) of a number || float (>= -1 and <= +1)|| align="center" |1 || align="center" |float | + | | <code>ACOS(num)</code> || Returns the arccosine (in radians) of a number || float (>= -1 and <= +1)|| align="center" |1 || align="center" |float || |
|- valign="top" | |- valign="top" | ||
− | | <code>ACOSH(num)</code> || Returns the inverse hyperbolic cosine of a number || float (>= 1) || align="center" |1 || align="center" |float | + | | <code>ACOSH(num)</code> || Returns the inverse hyperbolic cosine of a number || float (>= 1) || align="center" |1 || align="center" |float || |
|- valign="top" | |- valign="top" | ||
− | | <code>ASIN(num)</code> || Returns the arcsine (in radians) of a number || float (>= -1 and <= +1) || align="center" |1 || align="center" |float | + | | <code>ASIN(num)</code> || Returns the arcsine (in radians) of a number || float (>= -1 and <= +1) || align="center" |1 || align="center" |float || |
|- valign="top" | |- valign="top" | ||
− | | <code>ASINH(num)</code> || Returns the inverse hyperbolic sine of a number || float || align="center" |1 || align="center" |float | + | | <code>ASINH(num)</code> || Returns the inverse hyperbolic sine of a number || float || align="center" |1 || align="center" |float || |
+ | |- valign="top" | ||
+ | | <code>ATAN(num)</code> || Returns the arctangent (in radians) of a number || float || align="center" |1 || align="center" |float || | ||
|- valign="top" | |- valign="top" | ||
− | | <code> | + | | <code>ATANH(num)</code> || Returns the inverse hyperbolic tangent of a number || float (> -1 and < +1) || align="center" |1 || align="center" |float || |
|- valign="top" | |- valign="top" | ||
− | | <code> | + | | <code>CEILING(num,signif)</code> || Rounds a number up to next multiple of <code>sign</code> || float || align="center" |2 || align="center" |float || align="center"|sfExcel2 |
|- valign="top" | |- valign="top" | ||
− | | <code> | + | | <code>COS(num)</code> || Returns the cosine of an angle (in radians) || float || align="center" |1 || align="center" |float || |
|- valign="top" | |- valign="top" | ||
− | | <code> | + | | <code>COSH(num)</code> || Returns the hyperbolic cosine of a number || float || align="center" |1 || align="center" |float || |
|- valign="top" | |- valign="top" | ||
− | | <code> | + | | <code>DEGREES(num)</code> || Converts an angle from radians to degrees || float || align="center" |1 || align="center" |float || sfExcel2 |
|- valign="top" | |- valign="top" | ||
− | | <code> | + | | <code>EVEN(num)</code> || Rounds a pos number up, a neg number down to the next even integer || float || align="center" |1 || align="center"|integer || align="center"|sfExcel2 |
|- valign="top" | |- valign="top" | ||
− | | <code> | + | | <code>EXP(num)</code> || Calculates the exponential function of a number || float || align="center" |1 || align="center" |float || |
|- valign="top" | |- valign="top" | ||
− | | <code> | + | | <code>FACT(num)</code> || Calculates the factorial of a number || integer || align="center"|1 || align="center" |float || |
|- valign="top" | |- valign="top" | ||
− | | <code> | + | | <code>FLOOR(num,signif)</code> || Rounds a number down to next multiple of <code>sign</code> || float || align="center" |2 || align="center" |float || sfExcel2 |
|- valign="top" | |- valign="top" | ||
− | | <code> | + | | <code>INT(num)</code> || Returns the integer portion of a number (like "floor()") || float || align="center" |1 || align="center" |integer || |
|- valign="top" | |- valign="top" | ||
− | + | | <code>LN(num)</code> || Calculates the natural logarithm of a number || float (> 0) || align="center" |1 || align="center" |float || | |
− | |||
− | | <code>LN(num)</code> || Calculates the natural logarithm of a number || float (> 0) || align="center" |1 || align="center" |float | ||
|- valign="top" | |- valign="top" | ||
| <code>LOG(num [, base])</code> || Calculates the logarithm of a number to a specified base.<br> <code>base</code>, if omitted, is 10. || float (> 0) || align="center" |1 or 2 || align="center" |float | | <code>LOG(num [, base])</code> || Calculates the logarithm of a number to a specified base.<br> <code>base</code>, if omitted, is 10. || float (> 0) || align="center" |1 or 2 || align="center" |float | ||
|- valign="top" | |- valign="top" | ||
− | | <code>LOG10(num)</code> || Calculates the base-10 logarithm of a number || float (> 0) || align="center"|1 || align="center"|float | + | | <code>LOG10(num)</code> || Calculates the base-10 logarithm of a number || float (> 0) || align="center"|1 || align="center"|float || |
|- valign="top" | |- valign="top" | ||
− | | <code>ODD(num)</code> || Rounds a pos number up, a neg number down to the next odd integer || float || align="center" |1 || align="center"|integer | + | | <code>ODD(num)</code> || Rounds a pos number up, a neg number down to the next odd integer || float || align="center" |1 || align="center"|integer || sfExcel2 |
|- valign="top" | |- valign="top" | ||
− | | <code>PI()</code> || Returns the mathematical constant π (3.14159265358979) || none || align="center"|0 || align="center"|float | + | | <code>PI()</code> || Returns the mathematical constant π (3.14159265358979) || none || align="center"|0 || align="center"|float || |
|- valign="top" | |- valign="top" | ||
− | | <code>POWER(num, exponent)</code> || Returns the result of a number raised to a given power || float || align="center"|2 || align="center"|float | + | | <code>POWER(num, exponent)</code> || Returns the result of a number raised to a given power || float || align="center"|2 || align="center"|float || sfExcel2 |
|- valign="top" | |- valign="top" | ||
− | | <code>RADIANS(num)</code> || Converts an angle from degrees to radians || float || align="center"|1 or 2 || align="center"|float | + | | <code>RADIANS(num)</code> || Converts an angle from degrees to radians || float || align="center"|1 or 2 || align="center"|float || sfExcel2 |
|- valign="top" | |- valign="top" | ||
− | | <code>RAND()</code> || Returns a random number between 0 and 1 || none || align="center"|0 || align="center"|float | + | | <code>RAND()</code> || Returns a random number between 0 and 1 || none || align="center"|0 || align="center"|float || |
+ | |- valign="top" | ||
+ | | <code>ROUND(num, digits)</code> || Returns a number rounded to a specified number of digits || float || align="center"|2 || align="center"|float || | ||
|- valign="top" | |- valign="top" | ||
− | | <code> | + | | <code>SIGN(num)</code> || Returns the sign of a number || float || align="center"|1 || align="center"|integer || |
|- valign="top" | |- valign="top" | ||
− | | <code> | + | | <code>SIN(num)</code> || Returns the sine of an angle (in radians) || float || align="center"|1 || align="center"|float || |
|- valign="top" | |- valign="top" | ||
− | | <code> | + | | <code>SINH(num)</code> || Returns the hyperbolic sine of a number || float || align="center"|1 || align="center"|float || |
|- valign="top" | |- valign="top" | ||
− | | <code> | + | | <code>TAN(num)</code> || Returns the tangent of an angle (in radians) || float (<> (integer)*π/2) || align="center"|1 || align="center"|float || |
|- valign="top" | |- valign="top" | ||
− | + | | <code>TANH(num)</code> || Returns the hyperbolic tangent of a number || float || align="center"|1 || align="center"|float || | |
− | |||
− | | <code>TANH(num)</code> || Returns the hyperbolic tangent of a number || float || align="center"|1 || align="center"|float | ||
|- | |- | ||
− | | style="background:blue; color:white;" colspan=" | + | | style="background:blue; color:white;" colspan="6" | <b>Statistical functions</b> |
|- valign="top" | |- valign="top" | ||
− | | <code>AVEDEV(num1 [, num2, ...] )</code> || Average value of absolute deviations of data from their mean. || float || align="center"|> 1 || align="center" | float | + | | <code>AVEDEV(num1 [, num2, ...] )</code> || Average value of absolute deviations of data from their mean. || float || align="center"|> 1 || align="center" | float || sfExcel2 |
|- valign="top" | |- valign="top" | ||
− | | <code>AVERAGE(num1 [, num2, ...] )</code> || Average value of a series of numbers || float || align="center"|> 1 || align="center" | float | + | | <code>AVERAGE(num1 [, num2, ...] )</code> || Average value of a series of numbers || float || align="center"|> 1 || align="center" | float || |
|- valign="top" | |- valign="top" | ||
− | | <code>COUNT(value1 [, value2, ...] )</code> || Counts cells and arguments containing numbers || any || align="center"|> 1 || align="center" | integer | + | | <code>COUNT(value1 [, value2, ...] )</code> || Counts cells and arguments containing numbers || any || align="center"|> 1 || align="center" | integer || |
|- valign="top" | |- valign="top" | ||
− | | <code>COUNTA(value1 [, value2, ...] )</code> || Counts the number of non-empty cells and arguments || any || align="center"|> 1 || align="center" | integer | + | | <code>COUNTA(value1 [, value2, ...] )</code> || Counts the number of non-empty cells and arguments || any || align="center"|> 1 || align="center" | integer || |
|- valign="top" | |- valign="top" | ||
− | | <code>COUNTBLANK(range)</code> || Counts the number of empty cells in a range || cell range<br>(like A1:D5) || align="center"|1 || align="center"|integer | + | | <code>COUNTBLANK(range)</code> || Counts the number of empty cells in a range || cell range<br>(like A1:D5) || align="center"|1 || align="center"|integer || sfExcel2 |
|- valign="top" | |- valign="top" | ||
− | | <code>MAX(num1 [, num2, ...] )</code> || Returns the largest value from the numbers provided || float || align="center"|> 1 || align="center" | float | + | | <code>MAX(num1 [, num2, ...] )</code> || Returns the largest value from the numbers provided || float || align="center"|> 1 || align="center" | float || |
|- valign="top" | |- valign="top" | ||
− | | <code>MIN(num1 [, num2, ...] )</code> || Returns the smallest value from the numbers provided || float || align="center"|> 1 || align="center" | float | + | | <code>MIN(num1 [, num2, ...] )</code> || Returns the smallest value from the numbers provided || float || align="center"|> 1 || align="center" | float || |
|- valign="top" | |- valign="top" | ||
− | | <code>PRODUCT(num1 [, num2, ...] )</code> || Calculates the product of the numbers provided || float || align="center"|> 1 || align="center" | float | + | | <code>PRODUCT(num1 [, num2, ...] )</code> || Calculates the product of the numbers provided || float || align="center"|> 1 || align="center" | float || |
|- valign="top" | |- valign="top" | ||
− | | <code>STDEV(num1 [, num2, ...] )</code> || Returns the standard deviation of a population based on a ample of numbers || float || align="center"|> 1 || align="center" | float | + | | <code>STDEV(num1 [, num2, ...] )</code> || Returns the standard deviation of a population based on a ample of numbers || float || align="center"|> 1 || align="center" | float || |
|- valign="top" | |- valign="top" | ||
− | | <code>STDEVP(num1 [, num2, ...] )</code> || Returns the standard deviation of a population based on an entire population || float || align="center"|> 1 || align="center" | float | + | | <code>STDEVP(num1 [, num2, ...] )</code> || Returns the standard deviation of a population based on an entire population || float || align="center"|> 1 || align="center" | float || |
|- valign="top" | |- valign="top" | ||
− | | <code>SUM(num1 [, num2, ...] )</code> || Calculates the sum of the numbers provided || float || align="center"|> 1 || align="center" | float | + | | <code>SUM(num1 [, num2, ...] )</code> || Calculates the sum of the numbers provided || float || align="center"|> 1 || align="center" | float || |
|- valign="top" | |- valign="top" | ||
− | | <code>SUMSQ(num1 [, num2, ...] )</code> || Returns the sum of the squares of a series of numbers || float || align="center"|> 1 || align="center" | float | + | | <code>SUMSQ(num1 [, num2, ...] )</code> || Returns the sum of the squares of a series of numbers || float || align="center"|> 1 || align="center" | float || sfExcel2 |
|- valign="top" | |- valign="top" | ||
− | | <code>VAR(num1 [, num2, ...] )</code> || Returns the variance of a population based on a ample of numbers || float || align="center"|>1 || align="center" | float | + | | <code>VAR(num1 [, num2, ...] )</code> || Returns the variance of a population based on a ample of numbers || float || align="center"|>1 || align="center" | float || |
|- valign="top" | |- valign="top" | ||
− | | <code>VARP(num1 [, num2, ...] )</code> || Returns the variance of a population based on an entire population || float || align="center"|> 1 || align="center" | float | + | | <code>VARP(num1 [, num2, ...] )</code> || Returns the variance of a population based on an entire population || float || align="center"|> 1 || align="center" | float || |
|- valign="top" | |- valign="top" | ||
− | | style="background:blue; color:white;" colspan=" | + | | style="background:blue; color:white;" colspan="6" | <b>Date/time functions</b> |
|- valign="top" | |- valign="top" | ||
− | | <code>DATE(year, month, day)</code> || Calculates a serial date number from year, month and day || integer || align="center" |3 || align="center" | date/time | + | | <code>DATE(year, month, day)</code> || Calculates a serial date number from year, month and day || integer || align="center" |3 || align="center" | date/time || |
|- valign="top" | |- valign="top" | ||
− | | <code>DATEDIF(start_date, end_date, interval)</code> || Calculates the difference between two date value based on a given interval || <code>start_date, end_date</code>: date/time<br> <code>interval</code> is a string:<br>"Y" = number of years, <br>"M" = number of months, <br>"D" = number of days || align="center" |3 || align="center" | integer | + | | <code>DATEDIF(start_date, end_date, interval)</code> || Calculates the difference between two date value based on a given interval || <code>start_date, end_date</code>: date/time<br> <code>interval</code> is a string:<br>"Y" = number of years, <br>"M" = number of months, <br>"D" = number of days || align="center" |3 || align="center" | integer || sfExcel2 |
|- valign="top" | |- valign="top" | ||
− | | <code>DATEVALUE(date_string)</code> || Converts a (date) string to a date/time value. || string || align="center"|1 || align="center" | date/time | + | | <code>DATEVALUE(date_string)</code> || Converts a (date) string to a date/time value. || string || align="center"|1 || align="center" | date/time || |
|- valign="top" | |- valign="top" | ||
− | | <code>DAY(value)</code> || Extracts the day number (1..31) of a date value. || date/time, number, string || align="center"|1 || align="center" | integer | + | | <code>DAY(value)</code> || Extracts the day number (1..31) of a date value. || date/time, number, string || align="center"|1 || align="center" | integer || |
|- valign="top" | |- valign="top" | ||
− | | <code>HOUR(value)</code> || Extracts the hour (0..23) of a time value. || date/time, number, string || align="center"|1 || align="center" | integer | + | | <code>HOUR(value)</code> || Extracts the hour (0..23) of a time value. || date/time, number, string || align="center"|1 || align="center" | integer || |
|- valign="top" | |- valign="top" | ||
− | | <code>MINUTE(value)</code> || Extracts the minute (0..59) of a time value. || date/time, number, string || align="center"|1 || align="center" | integer | + | | <code>MINUTE(value)</code> || Extracts the minute (0..59) of a time value. || date/time, number, string || align="center"|1 || align="center" | integer || |
|- valign="top" | |- valign="top" | ||
− | | <code>MONTH(value)</code> || Extracts the month number (1..12) of a date value. || date/time, number, string || align="center"|1 || align="center" | integer | + | | <code>MONTH(value)</code> || Extracts the month number (1..12) of a date value. || date/time, number, string || align="center"|1 || align="center" | integer || |
|- valign="top" | |- valign="top" | ||
− | | <code>NOW()</code> || Returns the current system date and time. <br> Will refresh whenever the worksheet recalculates. || none || align="center"|0 || align="center" | date/time | + | | <code>NOW()</code> || Returns the current system date and time. <br> Will refresh whenever the worksheet recalculates. || none || align="center"|0 || align="center" | date/time || |
|- valign="top" | |- valign="top" | ||
− | | <code>SECOND(value)</code> || Extracts the second (0..59) of a time value. || date/time, number, string || align="center"|1 || align="center" | integer | + | | <code>SECOND(value)</code> || Extracts the second (0..59) of a time value. || date/time, number, string || align="center"|1 || align="center" | integer || |
|- valign="top" | |- valign="top" | ||
− | | <code>TIME(year, month, day)</code> || Calculates a date/time value from hours, minutes and seconds || integer || align="center" |3 || align="center" | date/time | + | | <code>TIME(year, month, day)</code> || Calculates a date/time value from hours, minutes and seconds || integer || align="center" |3 || align="center" | date/time || |
|- valign="top" | |- valign="top" | ||
− | | <code>TIMEVALUE(time_string)</code> || Converts a (time) string to a date/time value. || string || align="center"|1 || align="center" | date/time | + | | <code>TIMEVALUE(time_string)</code> || Converts a (time) string to a date/time value. || string || align="center"|1 || align="center" | date/time || |
|- valign="top" | |- valign="top" | ||
− | | <code>TODAY()</code> || Returns the current system date || none || align="center"|0 || align="center" | date/time | + | | <code>TODAY()</code> || Returns the current system date || none || align="center"|0 || align="center" | date/time || |
|- valign="top" | |- valign="top" | ||
− | | <code>WEEKDAY(value [, type])</code> || Returns a number code for the weekday of a date || <code>value</code>: date/time, number, string <br> <code>type=0</code>: Sunday=1, Saturday=7 (default)<br><code>type=1</code>: Monday=1, Sunday=7<br><code>type=2</code>: Monday=9, Sunday=6 || align="center"|1 or 2 || align="center" | integer | + | | <code>WEEKDAY(value [, type])</code> || Returns a number code for the weekday of a date || <code>value</code>: date/time, number, string <br> <code>type=0</code>: Sunday=1, Saturday=7 (default)<br><code>type=1</code>: Monday=1, Sunday=7<br><code>type=2</code>: Monday=9, Sunday=6 || align="center"|1 or 2 || align="center" | integer || |
|- valign="top" | |- valign="top" | ||
− | | <code>YEAR(value)</code> || Extracts the year of a date value. || date/time, number, string || align="center"|1 || align="center" | integer | + | | <code>YEAR(value)</code> || Extracts the year of a date value. || date/time, number, string || align="center"|1 || align="center" | integer || |
|- valign="top" | |- valign="top" | ||
− | | style="background:blue; color:white;" colspan=" | + | | style="background:blue; color:white;" colspan="6" | <b>String functions</b> |
|- valign="top" | |- valign="top" | ||
− | | <code>CHAR(ascii_value)</code> || Returns the character based on its ASCII value || integer || align="center" |1 || align="center" | string | + | | <code>CHAR(ascii_value)</code> || Returns the character based on its ASCII value || integer || align="center" |1 || align="center" | string || |
|- valign="top" | |- valign="top" | ||
− | | <code>CODE(text)</code> || Returns the ASCII code of the first character of a string || string || align="center" |1 || align="center" | integer | + | | <code>CODE(text)</code> || Returns the ASCII code of the first character of a string || string || align="center" |1 || align="center" | integer || |
|- valign="top" | |- valign="top" | ||
− | | <code>CONCATENATE(text1 [, text2, ...] )</code> || Joins strings together || float || align="center"|> 1 || align="center" | string | + | | <code>CONCATENATE(text1 [, text2, ...] )</code> || Joins strings together || float || align="center"|> 1 || align="center" | string || |
|- valign="top" | |- valign="top" | ||
− | | <code>EXACT(text1, text2)</code> || Compares two strings (case-sensitive) || float || align="center"|2 || align="center" | boolean | + | | <code>EXACT(text1, text2)</code> || Compares two strings (case-sensitive) || float || align="center"|2 || align="center" | boolean || |
|- valign="top" | |- valign="top" | ||
− | | <code>LEFT(text [, count])</code> || Returns the left-most characters of a string || <code>text</code>: string<br><code>count</code>: integer (default 1) || align="center" |1 or 2 || align="center" | string | + | | <code>LEFT(text [, count])</code> || Returns the left-most characters of a string || <code>text</code>: string<br><code>count</code>: integer (default 1) || align="center" |1 or 2 || align="center" | string || |
|- valign="top" | |- valign="top" | ||
− | | <code>LEN(text)</code> || Returns the character count of a string || string || align="center" |1 || align="center" | integer | + | | <code>LEN(text)</code> || Returns the character count of a string || string || align="center" |1 || align="center" | integer || |
|- valign="top" | |- valign="top" | ||
− | | <code>LOWER(text)</code> || Converts a string to lower-case characters || string || align="center" |1 || align="center" | string | + | | <code>LOWER(text)</code> || Converts a string to lower-case characters || string || align="center" |1 || align="center" | string || |
|- valign="top" | |- valign="top" | ||
− | | <code>MID(text, start_pos, count)</code> || Returns part of a string || <code>text</code>: string<br><code>start_pos, count</code>: integer || align="center" |3 || align="center" | string | + | | <code>MID(text, start_pos, count)</code> || Returns part of a string || <code>text</code>: string<br><code>start_pos, count</code>: integer || align="center" |3 || align="center" | string || |
|- valign="top" | |- valign="top" | ||
− | | <code>REPLACE(text, start_pos, count, new_text)</code> || Replaces a sequence of characters in a string with another string || <code>text</code>: string<br><code>start_pos, count</code>: integer<br><code>new_text</code>: string || align="center" |4 || align="center" | string | + | | <code>REPLACE(text, start_pos, count, new_text)</code> || Replaces a sequence of characters in a string with another string || <code>text</code>: string<br><code>start_pos, count</code>: integer<br><code>new_text</code>: string || align="center" |4 || align="center" | string || |
|- valign="top" | |- valign="top" | ||
− | | <code>REPT(text, count)</code> || Repeats a text a specified number of times || <code>text</code>: string<br><code>count</code>: integer<br> || align="center"|2 || align="center" | string | + | | <code>REPT(text, count)</code> || Repeats a text a specified number of times || <code>text</code>: string<br><code>count</code>: integer<br> || align="center"|2 || align="center" | string || |
|- valign="top" | |- valign="top" | ||
− | | <code>RIGHT(text [, count])</code> || Returns the right-most characters of a string || <code>text</code>: string<br><code>count</code>: integer (default 1) || align="center" |1 or 2 || align="center" | string | + | | <code>RIGHT(text [, count])</code> || Returns the right-most characters of a string || <code>text</code>: string<br><code>count</code>: integer (default 1) || align="center" |1 or 2 || align="center" | string || |
|- valign="top" | |- valign="top" | ||
− | | <code>SUBSTITUTE(text, old_text, new_text [, nth_appearance])</code> || Replaces part of a string with another string || <code>text, old_text, new_text</code>: string<br><code>nth_appearance</code>: integer<br>(default: replace all) || align="center"|3 or 4 || align="center" | string | + | | <code>SUBSTITUTE(text, old_text, new_text [, nth_appearance])</code> || Replaces part of a string with another string || <code>text, old_text, new_text</code>: string<br><code>nth_appearance</code>: integer<br>(default: replace all) || align="center"|3 or 4 || align="center" | string || |
|- valign="top" | |- valign="top" | ||
− | | <code>TRIM(text)</code> || Removes leading and trailing spaces from a string || string || align="center"|1 || align="center" | string | + | | <code>TRIM(text)</code> || Removes leading and trailing spaces from a string || string || align="center"|1 || align="center" | string || |
|- valign="top" | |- valign="top" | ||
− | | <code>UPPER(text)</code> || Converts a string to upper-case characters || string || align="center"|1 || align="center" | string | + | | <code>UPPER(text)</code> || Converts a string to upper-case characters || string || align="center"|1 || align="center" | string || |
|- valign="top" | |- valign="top" | ||
− | | <code>VALUE(text)</code> || Converts a string representing a number to a number || string || align="center"|1 || align="center" | float | + | | <code>VALUE(text)</code> || Converts a string representing a number to a number || string || align="center"|1 || align="center" | float || |
− | + | ||
|- valign="top" | |- valign="top" | ||
− | | style="background:blue; color:white;" colspan=" | + | | style="background:blue; color:white;" colspan="6" | <b>Logical functions</b> |
|- valign="top" | |- valign="top" | ||
− | | <code>AND(condition1 [, condition2, ...])</code> || Calculates the logical AND of several boolean values || boolean || align="center" |any || align="center" | boolean | + | | <code>AND(condition1 [, condition2, ...])</code> || Calculates the logical AND of several boolean values || boolean || align="center" |any || align="center" | boolean || |
|- valign="top" | |- valign="top" | ||
− | | <code>FALSE()</code> || Returns the boolean value FALSE || none || align="center"|0 || align="center" | boolean | + | | <code>FALSE()</code> || Returns the boolean value FALSE || none || align="center"|0 || align="center" | boolean || |
|- valign="top" | |- valign="top" | ||
− | | <code>IF(condition, value_true [, value_false])</code> || Returns <code>value_true</code> if <code>condition</code> is true,<br> or <code>value_false</code> (or false) if <code>condition</code> is false || <code>condition</code>: boolean<br><code>value_true, value_false</code>: any type || align="center"|2 or 3 || align="center" | any type | + | | <code>IF(condition, value_true [, value_false])</code> || Returns <code>value_true</code> if <code>condition</code> is true,<br> or <code>value_false</code> (or false) if <code>condition</code> is false || <code>condition</code>: boolean<br><code>value_true, value_false</code>: any type || align="center"|2 or 3 || align="center" | any type || |
|- valign="top" | |- valign="top" | ||
− | | <code>NOT(value)</code> || Inverts a boolean value || boolean || align="center"|1 || align="center" | boolean | + | | <code>NOT(value)</code> || Inverts a boolean value || boolean || align="center"|1 || align="center" | boolean || |
|- valign="top" | |- valign="top" | ||
− | | <code>OR(condition1 [, condition2, ...])</code> || Calculates the logical OR of several boolean values || boolean || align="center" |any || align="center" | boolean | + | | <code>OR(condition1 [, condition2, ...])</code> || Calculates the logical OR of several boolean values || boolean || align="center" |any || align="center" | boolean || |
|- valign="top" | |- valign="top" | ||
− | | <code>TRUE()</code> || Returns the boolean value TRUE || none || align="center"|0 || align="center" | boolean | + | | <code>TRUE()</code> || Returns the boolean value TRUE || none || align="center"|0 || align="center" | boolean || |
|- valign="top" | |- valign="top" | ||
− | | style="background:blue; color:white;" colspan=" | + | | style="background:blue; color:white;" colspan="6" | <b>Info functions</b> |
|- valign="top" | |- valign="top" | ||
− | | <code>ISBLANK(value)</code> || Checks for blank or null values. || any, usually cell || align="center"|1 || align="center"|boolean | + | | <code>ISBLANK(value)</code> || Checks for blank or null values. || any, usually cell || align="center"|1 || align="center"|boolean || |
|- valign="top" | |- valign="top" | ||
− | | <code>ISERR(value)</code> || Returns TRUE if <code>value</code> is an error but not #N/A || any, usually cell || align="center"|1 || align="center"|boolean | + | | <code>ISERR(value)</code> || Returns TRUE if <code>value</code> is an error but not #N/A || any, usually cell || align="center"|1 || align="center"|boolean || |
|- valign="top" | |- valign="top" | ||
− | | <code>ISERROR(value)</code> || Returns TRUE if <code>value</code> is an error value (#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME? or #NULL). || any, usually cell || align="center"|1 || align="center"|boolean | + | | <code>ISERROR(value)</code> || Returns TRUE if <code>value</code> is an error value (#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME? or #NULL). || any, usually cell || align="center"|1 || align="center"|boolean || |
|- valign="top" | |- valign="top" | ||
− | | <code>ISLOGICAL(value)</code> || Returns TRUE if <code>value</code> is boolean || any, usually cell || align="center"|1 || align="center"|boolean | + | | <code>ISLOGICAL(value)</code> || Returns TRUE if <code>value</code> is boolean || any, usually cell || align="center"|1 || align="center"|boolean || |
|- valign="top" | |- valign="top" | ||
− | | <code>ISNA(value)</code> || Returns TRUE if <code>value</code> is a #N/A error || any, usually cell || align="center"|1 || align="center"|boolean | + | | <code>ISNA(value)</code> || Returns TRUE if <code>value</code> is a #N/A error || any, usually cell || align="center"|1 || align="center"|boolean || |
|- valign="top" | |- valign="top" | ||
− | | <code>ISNONTEXT(value)</code> || Returns TRUE if <code>value</code> is not a string || any, usually cell || align="center"|1 || align="center"|boolean | + | | <code>ISNONTEXT(value)</code> || Returns TRUE if <code>value</code> is not a string || any, usually cell || align="center"|1 || align="center"|boolean || |
|- valign="top" | |- valign="top" | ||
− | | <code>ISNUMBER(value)</code> || Returns TRUE if <code>value</code> is a number || any, usually cell || align="center"|1 || align="center"|boolean | + | | <code>ISNUMBER(value)</code> || Returns TRUE if <code>value</code> is a number || any, usually cell || align="center"|1 || align="center"|boolean || |
|- valign="top" | |- valign="top" | ||
− | | <code>ISREF(value)</code> || Returns TRUE if <code>value</code> is a cell reference || any, usually cell || align="center"|1 || align="center"|boolean | + | | <code>ISREF(value)</code> || Returns TRUE if <code>value</code> is a cell reference || any, usually cell || align="center"|1 || align="center"|boolean || |
|- valign="top" | |- valign="top" | ||
− | | <code>ISTEXT(value)</code> || Returns TRUE if <code>value</code> is a string || any, usually cell || align="center"|1 || align="center"|boolean | + | | <code>ISTEXT(value)</code> || Returns TRUE if <code>value</code> is a string || any, usually cell || align="center"|1 || align="center"|boolean || |
|- valign="top" | |- valign="top" | ||
|- | |- | ||
|} | |} |
Revision as of 00:34, 2 September 2014
This is a list of the formulas supported by FPSpreadsheet.
Note: The arguments can be constants of the given type, or cells containing values of the given type
Calling prototye | Meaning | Argument types | Arguments | Result type | Not for |
---|---|---|---|---|---|
Mathematical functions | |||||
ABS(num) |
Returns the absolute value of a number | float | 1 | float | |
ACOS(num) |
Returns the arccosine (in radians) of a number | float (>= -1 and <= +1) | 1 | float | |
ACOSH(num) |
Returns the inverse hyperbolic cosine of a number | float (>= 1) | 1 | float | |
ASIN(num) |
Returns the arcsine (in radians) of a number | float (>= -1 and <= +1) | 1 | float | |
ASINH(num) |
Returns the inverse hyperbolic sine of a number | float | 1 | float | |
ATAN(num) |
Returns the arctangent (in radians) of a number | float | 1 | float | |
ATANH(num) |
Returns the inverse hyperbolic tangent of a number | float (> -1 and < +1) | 1 | float | |
CEILING(num,signif) |
Rounds a number up to next multiple of sign |
float | 2 | float | sfExcel2 |
COS(num) |
Returns the cosine of an angle (in radians) | float | 1 | float | |
COSH(num) |
Returns the hyperbolic cosine of a number | float | 1 | float | |
DEGREES(num) |
Converts an angle from radians to degrees | float | 1 | float | sfExcel2 |
EVEN(num) |
Rounds a pos number up, a neg number down to the next even integer | float | 1 | integer | sfExcel2 |
EXP(num) |
Calculates the exponential function of a number | float | 1 | float | |
FACT(num) |
Calculates the factorial of a number | integer | 1 | float | |
FLOOR(num,signif) |
Rounds a number down to next multiple of sign |
float | 2 | float | sfExcel2 |
INT(num) |
Returns the integer portion of a number (like "floor()") | float | 1 | integer | |
LN(num) |
Calculates the natural logarithm of a number | float (> 0) | 1 | float | |
LOG(num [, base]) |
Calculates the logarithm of a number to a specified base.base , if omitted, is 10. |
float (> 0) | 1 or 2 | float | |
LOG10(num) |
Calculates the base-10 logarithm of a number | float (> 0) | 1 | float | |
ODD(num) |
Rounds a pos number up, a neg number down to the next odd integer | float | 1 | integer | sfExcel2 |
PI() |
Returns the mathematical constant π (3.14159265358979) | none | 0 | float | |
POWER(num, exponent) |
Returns the result of a number raised to a given power | float | 2 | float | sfExcel2 |
RADIANS(num) |
Converts an angle from degrees to radians | float | 1 or 2 | float | sfExcel2 |
RAND() |
Returns a random number between 0 and 1 | none | 0 | float | |
ROUND(num, digits) |
Returns a number rounded to a specified number of digits | float | 2 | float | |
SIGN(num) |
Returns the sign of a number | float | 1 | integer | |
SIN(num) |
Returns the sine of an angle (in radians) | float | 1 | float | |
SINH(num) |
Returns the hyperbolic sine of a number | float | 1 | float | |
TAN(num) |
Returns the tangent of an angle (in radians) | float (<> (integer)*π/2) | 1 | float | |
TANH(num) |
Returns the hyperbolic tangent of a number | float | 1 | float | |
Statistical functions | |||||
AVEDEV(num1 [, num2, ...] ) |
Average value of absolute deviations of data from their mean. | float | > 1 | float | sfExcel2 |
AVERAGE(num1 [, num2, ...] ) |
Average value of a series of numbers | float | > 1 | float | |
COUNT(value1 [, value2, ...] ) |
Counts cells and arguments containing numbers | any | > 1 | integer | |
COUNTA(value1 [, value2, ...] ) |
Counts the number of non-empty cells and arguments | any | > 1 | integer | |
COUNTBLANK(range) |
Counts the number of empty cells in a range | cell range (like A1:D5) |
1 | integer | sfExcel2 |
MAX(num1 [, num2, ...] ) |
Returns the largest value from the numbers provided | float | > 1 | float | |
MIN(num1 [, num2, ...] ) |
Returns the smallest value from the numbers provided | float | > 1 | float | |
PRODUCT(num1 [, num2, ...] ) |
Calculates the product of the numbers provided | float | > 1 | float | |
STDEV(num1 [, num2, ...] ) |
Returns the standard deviation of a population based on a ample of numbers | float | > 1 | float | |
STDEVP(num1 [, num2, ...] ) |
Returns the standard deviation of a population based on an entire population | float | > 1 | float | |
SUM(num1 [, num2, ...] ) |
Calculates the sum of the numbers provided | float | > 1 | float | |
SUMSQ(num1 [, num2, ...] ) |
Returns the sum of the squares of a series of numbers | float | > 1 | float | sfExcel2 |
VAR(num1 [, num2, ...] ) |
Returns the variance of a population based on a ample of numbers | float | >1 | float | |
VARP(num1 [, num2, ...] ) |
Returns the variance of a population based on an entire population | float | > 1 | float | |
Date/time functions | |||||
DATE(year, month, day) |
Calculates a serial date number from year, month and day | integer | 3 | date/time | |
DATEDIF(start_date, end_date, interval) |
Calculates the difference between two date value based on a given interval | start_date, end_date : date/timeinterval is a string:"Y" = number of years, "M" = number of months, "D" = number of days |
3 | integer | sfExcel2 |
DATEVALUE(date_string) |
Converts a (date) string to a date/time value. | string | 1 | date/time | |
DAY(value) |
Extracts the day number (1..31) of a date value. | date/time, number, string | 1 | integer | |
HOUR(value) |
Extracts the hour (0..23) of a time value. | date/time, number, string | 1 | integer | |
MINUTE(value) |
Extracts the minute (0..59) of a time value. | date/time, number, string | 1 | integer | |
MONTH(value) |
Extracts the month number (1..12) of a date value. | date/time, number, string | 1 | integer | |
NOW() |
Returns the current system date and time. Will refresh whenever the worksheet recalculates. |
none | 0 | date/time | |
SECOND(value) |
Extracts the second (0..59) of a time value. | date/time, number, string | 1 | integer | |
TIME(year, month, day) |
Calculates a date/time value from hours, minutes and seconds | integer | 3 | date/time | |
TIMEVALUE(time_string) |
Converts a (time) string to a date/time value. | string | 1 | date/time | |
TODAY() |
Returns the current system date | none | 0 | date/time | |
WEEKDAY(value [, type]) |
Returns a number code for the weekday of a date | value : date/time, number, string type=0 : Sunday=1, Saturday=7 (default)type=1 : Monday=1, Sunday=7type=2 : Monday=9, Sunday=6 |
1 or 2 | integer | |
YEAR(value) |
Extracts the year of a date value. | date/time, number, string | 1 | integer | |
String functions | |||||
CHAR(ascii_value) |
Returns the character based on its ASCII value | integer | 1 | string | |
CODE(text) |
Returns the ASCII code of the first character of a string | string | 1 | integer | |
CONCATENATE(text1 [, text2, ...] ) |
Joins strings together | float | > 1 | string | |
EXACT(text1, text2) |
Compares two strings (case-sensitive) | float | 2 | boolean | |
LEFT(text [, count]) |
Returns the left-most characters of a string | text : stringcount : integer (default 1) |
1 or 2 | string | |
LEN(text) |
Returns the character count of a string | string | 1 | integer | |
LOWER(text) |
Converts a string to lower-case characters | string | 1 | string | |
MID(text, start_pos, count) |
Returns part of a string | text : stringstart_pos, count : integer |
3 | string | |
REPLACE(text, start_pos, count, new_text) |
Replaces a sequence of characters in a string with another string | text : stringstart_pos, count : integernew_text : string |
4 | string | |
REPT(text, count) |
Repeats a text a specified number of times | text : stringcount : integer |
2 | string | |
RIGHT(text [, count]) |
Returns the right-most characters of a string | text : stringcount : integer (default 1) |
1 or 2 | string | |
SUBSTITUTE(text, old_text, new_text [, nth_appearance]) |
Replaces part of a string with another string | text, old_text, new_text : stringnth_appearance : integer(default: replace all) |
3 or 4 | string | |
TRIM(text) |
Removes leading and trailing spaces from a string | string | 1 | string | |
UPPER(text) |
Converts a string to upper-case characters | string | 1 | string | |
VALUE(text) |
Converts a string representing a number to a number | string | 1 | float |
|
Logical functions | |||||
AND(condition1 [, condition2, ...]) |
Calculates the logical AND of several boolean values | boolean | any | boolean | |
FALSE() |
Returns the boolean value FALSE | none | 0 | boolean | |
IF(condition, value_true [, value_false]) |
Returns value_true if condition is true,or value_false (or false) if condition is false |
condition : booleanvalue_true, value_false : any type |
2 or 3 | any type | |
NOT(value) |
Inverts a boolean value | boolean | 1 | boolean | |
OR(condition1 [, condition2, ...]) |
Calculates the logical OR of several boolean values | boolean | any | boolean | |
TRUE() |
Returns the boolean value TRUE | none | 0 | boolean | |
Info functions | |||||
ISBLANK(value) |
Checks for blank or null values. | any, usually cell | 1 | boolean | |
ISERR(value) |
Returns TRUE if value is an error but not #N/A |
any, usually cell | 1 | boolean | |
ISERROR(value) |
Returns TRUE if value is an error value (#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME? or #NULL). |
any, usually cell | 1 | boolean | |
ISLOGICAL(value) |
Returns TRUE if value is boolean |
any, usually cell | 1 | boolean | |
ISNA(value) |
Returns TRUE if value is a #N/A error |
any, usually cell | 1 | boolean | |
ISNONTEXT(value) |
Returns TRUE if value is not a string |
any, usually cell | 1 | boolean | |
ISNUMBER(value) |
Returns TRUE if value is a number |
any, usually cell | 1 | boolean | |
ISREF(value) |
Returns TRUE if value is a cell reference |
any, usually cell | 1 | boolean | |
ISTEXT(value) |
Returns TRUE if value is a string |
any, usually cell | 1 | boolean |