Formulas in Laserfiche Forms
Laserfiche Forms supports a variety of functions that you can use in the following fields in a form: single line, number, date, currency, table, and collection. After you enter a formula into a form, the field on the form is populated automatically with the result of the formula calculation.
To apply a formula to a field, go to the Advanced tab of the field and either type in the text box within the Calculation section or use the Insert formula button in the top left.
When you type in the text box, be sure to use the OpenFormula standard specified in the Formulas section below. The OpenFormula standard is the same standard used by Microsoft Excel and Google Sheets. Also, add an equal sign "=" to the beginning of the formula. For example, type "=SUM(collection1.val1, 2)".
Note: A read-only field configured to use a formula cannot be used to trigger a lookup rule.
Name | Format | Description |
---|---|---|
ABS | ABS(value) |
The ABS function returns the absolute value of the specified value.
|
ADD | ADD(value1, value2) |
The ADD function returns the sum of two values.
|
ADD_MONTHS | ADD_MONTHS(date, months) |
The ADD_MONTHS function adds months to a date object and returns a date object.
|
AND | AND(value1, value2, ...) |
The AND function returns "true" if all specified values are true; otherwise, it returns false.
|
AVERAGE | AVERAGE(value1, value2, ...) |
The AVERAGE function returns the average of a list of values.
|
AVERAGEA | AVERAGEA(value1, value2, ...) |
The AVERAGEA function returns the average of a list of values, where "true" is treated as 1 and "false" and text are treated as 0.
|
AVERAGEIF | AVERAGEIF([value1, value2, ...], criterion) |
The AVERAGEIF function returns the average of a list of number values that satisfy the criterion.
|
AVG | AVG(value1, value2, ...) |
The AVG function returns the average of a list of values.
|
CEILING | CEILING(value, factor) |
The CEILING function rounds the specified value up to the nearest multiple of the factor.
|
CHAR | CHAR(value) |
The CHAR function returns a character representation of a number based on the Unicode table.
|
CHOOSE | CHOOSE(index, val1, val2, ...) |
The CHOOSE function returns the value at the index provided as the first argument.
|
CHOOSEA | CHOOSEA(index, val1, val2, ...) |
The CHOOSEA function returns the value at the index in the first argument. If more than one input exists in one value, the function is flattened.
|
CODE | CODE(value) |
The CODE function returns a number based on the Unicode table that represents the character.
|
COLUMN | COLUMN() |
The COLUMN function returns the column number of a cell in a table. The first cell has a value of 1.
|
CONCATENATE | CONCATENATE(value1, value2, ...) |
The CONCATENATE function joins multiple strings together into one string. Also see JOIN.
|
COUNT | COUNT(value1, value2, ...) |
The COUNT function tallies the number of non-numeric, listed values.
|
COUNTIF | COUNTIF([value1, value2, ...], "condition") |
The COUNTIF function tallies the number of listed values that satisfy the condition.
|
DATE | DATE(year, month, day) |
The DATE function returns a date object representation of a date. You can use this date object in various other functions, including DAY, MONTH, and YEAR.
Note: When used with a date-based variable or field, the date will be formatted as defined by the field or variable. |
DATEDIF | DATEDIF(start_date, end_date, time_unit) |
The DATEDIF function calculates the difference between two date objects based on a specific unit.
|
DATEVALUE | DATEVALUE(dateString) |
The DATEVALUE function converts a date (stored as text) into a date object.
|
DAY | DAY(dateValue) |
The DAY function returns the day of a given date.
|
DAYS360 | DAYS360(start_date, end_date) |
The DAYS360 function returns the number of days between two given dates. This is sometimes used in financial interest calculations.
|
DIV | DIV(value1, value2) |
The DIV function divides the first value by the second value.
|
EDATE | EDATE(DateObject, months) |
The EDATE function adds an integer number of months to a date object to return another date object. If the months are non-integer values, then the function is rounded and then added.
Note: When used with a date-based variable or field, the date will be formatted as defined by the field or variable. |
EOMONTH | EOMONTH(DateObject, months) |
The EOMONTH function adds an integer number of months to a date object then returns a date object with the day as the end of that month.
Note: When used with a date-based variable or field, the date will be formatted as defined by the field or variable. |
EQ | EQ(value1, value2) |
The EQ function returns "true" if the two values are equal, "false" otherwise.
|
EVEN | EVEN(value) |
The EVEN function rounds the value up to the nearest even number.
|
EXACT | EXACT(value1, value2) |
The EXACT function converts both values to text, and returns "true" if the two strings are identical, "false" otherwise.
|
EXP | EXP(exponent) |
The EXP function returns Euler's number (~2.718) raised to the power of the value you provide.
|
FIND | FIND(targetText, textToSearch, startingCharacter) |
The FIND function returns the number of digits before finding the first value in the second value. The function performs the search starting with the starting character.
|
FIXED | FIXED(value, significance) |
The FIXED function returns a number based on a specific number of significant digits.
|
FLOOR | FLOOR(value, factor) |
The FLOOR function rounds the specified value down to the nearest multiple of the factor.
|
GT | GT(value1, value2) |
The GT function returns "true" if the first value is greater than the second, "false" otherwise.
|
GTE | GTE(value1, value2) |
The GTE function returns "true" if the first value is greater than or equal to the second, "false" otherwise.
|
HOUR | HOUR(timeValue) |
The HOUR function returns the hour (from 0 to 23) of a given time object.
|
IDIV | IDIV(value1, value2) |
The IDIV function divides the first value by the second value and drops the remainder.
|
IF | IF(booleanValue, value1, value2) |
The IF function returns the second value when the first value is true, otherwise returns the third value.
|
INDEX | INDEX(column, row) |
The INDEX function returns a specific item in an array.
|
ISEVEN | ISEVEN(value) |
The ISEVEN function returns "true" if the value is even, otherwise "false".
|
ISODD | ISODD(value) |
The ISODD function returns "true" if the value is odd, otherwise "false".
|
JOIN | JOIN(delimiter, array) |
The JOIN function concatenates the values in an array into one string. Each value is separate by the delimiter. Also see CONCATENATE.
|
LARGE | LARGE(NumbersList, n) |
The LARGE function returns the nth largest value in a list of numbers.
|
LEFT | LEFT(string, [characters]) |
The LEFT function returns all the characters from the left up to a specific number of characters.
|
LEN | LEN(text) |
The LEN function returns the length of text.
|
LN | LN(number) |
The LN function returns the natural logarithm of a value.
|
LOG | LOG(number, base) |
The LOG function returns the logarithm of a value for a specific base.
|
LOG10 | LOG10(number) |
The LOG10 function returns the logarithm of a value for base 10.
|
LOWER | LOWER(text) |
The LOWER function converts a text value into lowercase.
|
LT | LT(value1, value2) |
The LT function returns "true" if the first value is less than the second, "false" otherwise.
|
LTE | LTE(value1, value2) |
The LTE function returns "true" if the first value is less than or equal to the second, "false" otherwise.
|
MAX | MAX(value1, value2, ...) |
The MAX function returns the maximum numerical value in a list of values. The function ignores non-numeric values.
|
MAXA | MAXA(value1, value2,...) |
The MAXA function returns the maximum value in a list of values. The function considers text values and the Boolean "false" as 0, and the Boolean "true" as 1.
|
MEDIAN | MEDIAN(value1, value2,...) |
The MEDIAN function returns the middle value in a list of values. When the list contains an even number of values, the function returns the average of the two middle values.
|
MID | MID(text, startingCharacter, length) |
The MID function extracts a part of text starting with the first character and ending after a specified length.
|
MIN | MIN(value1, value2 ,...) |
The MIN function returns the minimum numerical value in a list of values. The function ignores non-numeric values.
|
MINA | MINA(value1, value2, ...) |
The MINA function returns the minimum value in a list of values. The function considers text values and the Boolean "false" as 0, and the Boolean "true" as 1.
|
MINUS | MINUS(value) |
The MINUS function returns the opposite of the current number sign.
|
MINUTE | MINUTE(timeValue) |
The MINUTE function returns the minute value in a time object.
|
MOD | MOD(value1, value2) |
The MOD function returns the remainder from dividing the first number by the second. Learn more
|
MODE | MODE(value1, value2,...) |
The MODE function returns the most frequent value in a list of values.
|
MONTH | MONTH(dateValue) |
The MONTH function returns the month (from 1 to 12) in a date object.
|
MROUND | MROUND(value, multiple) |
The MROUND function returns the first value to the nearest multiple of the second value.
|
MULT | MULT(value1, value2) |
The MULT function returns the first value multiplied by the second.
|
NEQ | NEQ(value1, value2) |
The NEQ function returns "true" if the two values are not equal, "false" otherwise.
|
NETWORKDAYS | NETWORKDAYS(startDate, endDate, [holidays], [weekDays]) |
The NETWORKDAYS function returns the whole number of work days between two date objects.
|
NOT | NOT(value) |
The NOT function returns "true" if the value is false, or "false" if the value is true.
|
NOW | NOW() |
The NOW function returns the current date and time.
|
ODD | ODD(value) |
The ODD function returns the value rounded to the nearest odd number, away from zero.
|
OR | OR(value1, value2, ...) |
The OR function returns "true" if any of the specified values are true, "false" otherwise.
|
PI | PI() |
The PI function returns the approximate value of Pi.
|
POWER | POWER(value, exponent) |
The POWER function returns the first value raised to the power of the second value.
|
PRODUCT | PRODUCT(value1, value2,...) |
The PRODUCT function calculates the product of all numeric values in a list of values.
|
PROPER | PROPER(text) |
The PROPER function returns the specified text value with the first letter in a text string and any other letters in the string that follow any character other than a letter converted to uppercase.
|
QUOTIENT | QUOTIENT(value1, value2) |
The QUOTIENT function returns the integer from dividing the first value by the second.
|
REPLACE | REPLACE(old_string, start_position, count, new_string) |
The REPLACE function returns a text value from modifying the first value at the location from the second value to the third value based on the fourth value.
|
REPT | REPT(text, number) |
The REPT function returns a specified text value repeated by a number of times.
|
RIGHT | RIGHT(value, n) |
The RIGHT function returns all the characters from the right up to a specific number of characters.
|
ROUND | ROUND(value, places) |
The ROUND function returns the value rounded to the specified number of decimal places.
|
ROUNDDOWN | ROUNDDOWN(value, places) |
The ROUNDDOWN function returns the value rounded down to the specified number of decimal places.
|
ROUNDUP | ROUNDUP(value, places) |
The ROUNDUP function returns the value rounded up to the specified number of decimal places.
|
ROW | ROW() |
The ROW function returns the row number of a cell in a table. The first cell has a value of 1.
|
SECOND | SECOND(timeValue) |
The SECOND function returns the second (from 0 to 59) of a time object.
|
SIGN | SIGN(value) |
The SIGN function returns "1" if the specified value is greater than zero, "-1" if it is less than zero, and "0" if it is zero.
|
SPLIT | SPLIT(textValue, textSplit) |
The SPLIT function returns an array of values, where the first value is split up based on the method for splitting.
|
SQRT | SQRT(value) |
The SQRT function calculates the square root of the specified value.
|
SUB | SUB(value1, value2) |
The SUB function returns the difference between the first and second values.
|
SUBSTITUTE | SUBSTITUTE(text, target text, replacement text, number) |
The SUBSTITUTE function replaces existing text values with updated text values. The "number" parameter is optional, and specifies the position of found instances to replace if there is more than one. "=SUBSTITUTE("Employees: Susan Marks, Paul Smith, Eric Marks", "Marks", "Johnson", 1)" returns "Employees: Susan Johnson, Paul Smith, Eric Marks" "=SUBSTITUTE("Employees: Susan Marks, Paul Smith, Eric Marks", "Marks", "Johnson", 2)" returns "Employees: Susan Marks, Paul Smith, Eric Johnson" |
SUM | SUM(value1, value2, ...) |
The SUM function calculates the sum of all the number values in a list.
|
SUMIF | SUMIF([value1,value2,...],"condition", [sum_range]) |
The SUMIF function calculates the sum of all the number values in a list that satisfy the condition.
|
SUMIFS | SUMIFS(reference, range1, criterion1, range2, criterion2, ...) |
=SUMIFS([1,1,3], [3,2,3], ">2", [4,5,6], "<6") returns "1", because the first value in range 1 is "3" and the first value in range 2 is "4". "3" fits criterion 1 because 3 is greater than 2 and "4" fits criterion 2 because 4 is less than 6, so "1" (in the reference) is a hit. Similarly, the second "1" is a hit. However, "3" is not a hit because 6 is not less than 6 in the second range. |
T | T(value) |
The T function returns a string as text.
|
TEXT | TEXT(number) |
The TEXT function converts a specified value to a string.
|
TIME | TIME(hours, minutes, seconds) |
The TIME function returns the time as a fraction of a day. You can use this fraction in various other functions, including SECOND, MINUTE, and HOUR.
|
TIMEVALUE | TIMEVALUE(timestring) |
The TIMEVALUE function returns the time as a fraction of a day. Inputs can be in the form "HH:MM", "HH:MM:SS", "YYYY-MM-DD HH:MM:SS", or "YYYY-MM-DD HH:MM".
|
TRIM | TRIM(text) |
The TRIM function removes spaces before and after a specified value.
|
TRUNC | TRUNC(value1, value2) |
The TRUNC function shortens (or "truncates") the first value to the number of decimal places in the second value. If the second value is absent or set to zero, the function shortens to an integer.
|
UPPER | UPPER(text) |
The UPPER function converts the specified text to all uppercase letters.
|
VALUE | VALUE(input) |
The VALUE function converts a specified value to a number.
|
WEEKDAY | WEEKDAY(date, [type]) |
The WEEKDAY function returns the day of the week for the specified date as a number. You can type "1", "2", or "3" to determine whether the first day of the week is a Sunday or Monday.
|
WEEKNUM | WEEKNUM(date, mode) |
The WEEKNUM function returns the number of the week in a year for a specified date object.
|
WORKDAY | WORKDAY(startDay, numDays) |
The WORKDAY function returns a date object based on the number of days after a start day.
|
YEAR | YEAR(dateValue) |
The YEAR function returns the year of a given date object.
|
YEARFRAC | YEARFRAC(startDate, endDate, [basis]) |
Computes the fraction of the number of years between a startDate and endDate. Basis{0,1} uses US (NASD) 30/360 and Actual/365 to compute days. Excluding the [basis] defaults to "0".
|