---
title: "Formula Functions"
description: "Every function a calculation formula can call, with its arguments, result, blank behaviour and examples, and the deviation register."
slug: "formula-functions"
audience: "all"
generated_at: "2026-11-17T19:07:44.633Z"
screenshots:
  []
---

This reference is generated from the formula engine's function registry, so it lists exactly the functions a calculation formula can call. Write a function as its name followed by its arguments in brackets, separated by commas, for example `IF(qty > 10, 0, 5)`. A function's name is not case-sensitive. In the formula editor, choose a function category in the palette, then choose a function to insert it. An argument hint beneath the formula shows which argument you are on.

Each entry gives the function's arguments, what it returns, what it does when an argument is blank (an unanswered or hidden field), and at least one example. Where a function behaves differently from its Salesforce or Excel namesake, the entry says so, and the [deviation register](#deviation-register) at the end collects every such difference. How a formula names a field, which operators it accepts and where a calculated result can go are covered in the Calculations & Default Values article.

## Logical

### IF

`IF(condition, value_if_true, value_if_false)`

Chooses between two values: the first when the condition is true, the second otherwise.

- `condition` (a yes/no answer): A yes/no question, such as a comparison.
- `value_if_true` (any value): The result when the condition is true.
- `value_if_false` (any value): The result otherwise. Must be the same kind of value as value_if_true.
- Returns: the same kind of value as value_if_true and value_if_false, which must agree.
- Blank: A blank condition is not true, so IF takes the otherwise branch — as Salesforce and Excel do. A blank in the branch taken is the result.
- Example: `IF(qty > 10, 0, 5)` gives 0 when more than 10 are ordered, otherwise 5

### AND

`AND(condition, ...)`

True when every condition is true, and false as soon as one is not.

- `condition` (a yes/no answer): A yes/no question, such as a comparison.
- Returns: a yes/no answer.
- Blank: A blank condition is not true, so AND gives FALSE there — as Salesforce does.
- Example: `AND(qty > 0, total / qty > 5)` gives TRUE when an item costs more than 5; FALSE, not an error, when qty is 0
- Deviation: Stops at the first condition that is not true, so a later one never runs: AND(qty > 0, total / qty > 5) is FALSE when qty is 0, not an error. Excel and FormAssembly Classic work out every condition.

### OR

`OR(condition, ...)`

True as soon as one condition is true, and false when none is.

- `condition` (a yes/no answer): A yes/no question, such as a comparison.
- Returns: a yes/no answer.
- Blank: A blank condition is not true, so OR moves on to the next one; when every condition is blank the result is FALSE — as Salesforce does.
- Example: `OR(country = "US", country = "CA")` gives TRUE when country is US or CA
- Deviation: Stops at the first true condition, so a later one never runs and its error cannot surface. Excel and FormAssembly Classic work out every condition.

### NOT

`NOT(condition)`

True when the condition is false, and false when it is true.

- `condition` (a yes/no answer): A yes/no question, such as a comparison.
- Returns: a yes/no answer.
- Blank: NOT of a blank condition is blank — as Salesforce does.
- Example: `NOT(ISBLANK(email))` gives TRUE when email has been answered

## Math

### ROUND

`ROUND(number, digits)`

Rounds a number to a number of decimal places, halves away from zero.

- `number` (a number): The number to round.
- `digits` (a number): How many decimal places to keep. 0 rounds to a whole number; a negative count rounds to tens, hundreds and so on. A fraction here is cut to its whole part.
- Returns: a number.
- Blank: A blank number or a blank digits gives blank, as a blank operand does in arithmetic. ROUND(10, 2) is 10: no trailing zeros are added.
- Example: `ROUND(price * 1.0825, 2)` gives the price plus 8.25% tax, to two decimal places
- Example: `ROUND(-2.5, 0)` gives -3, because halves round away from zero
- Deviation: Excel reads a blank cell as 0 here; this language propagates the blank instead, because a substituted zero cannot be told from a computed one (formula-language.md § Operators).

## Information

### ISBLANK

`ISBLANK(value)`

True when the value is blank: an unanswered question or an empty answer.

- `value` (any value): The value to test.
- Returns: a yes/no answer.
- Blank: A blank is the case this function exists for: ISBLANK of a blank is TRUE, never blank. Zero, FALSE and a date are answers, so ISBLANK of each is FALSE.
- Example: `ISBLANK(phone)` gives TRUE when phone is unanswered or empty
- Deviation: Empty text is blank, so ISBLANK of a text field the respondent cleared, or of a text expression that works out to "", is TRUE — as Salesforce reads it. Excel treats a cell holding "" as occupied, because it was written to; a form has no such state, and that answer would be FALSE for exactly the case an author reaches for.

### BLANKVALUE

`BLANKVALUE(value, fallback)`

Gives the value, or the fallback when the value is blank.

- `value` (any value): The value to use when it is not blank.
- `fallback` (any value): The result when the value is blank. Must be the same kind of value as value.
- Returns: the same kind of value as value and fallback, which must agree.
- Blank: A blank value gives the fallback; that is what the function is for. Empty text counts as blank here, as it does for ISBLANK. A blank fallback gives blank, so BLANKVALUE(a, b) is blank only when both are — as Salesforce does.
- Example: `BLANKVALUE(qty, 1)` gives qty, or 1 when qty is blank

## Text

### CONCATENATE

`CONCATENATE(value, ...)`

Joins any number of values into one text, converting each as & does.

- `value` (any value): A value to join: text as it is, a number with . as the decimal separator, a yes/no answer as TRUE or FALSE, a date as YYYY-MM-DD and a time as HH:MM:SS.
- Returns: text.
- Blank: A blank joins as the empty string, as it does under &, so the result is never blank.
- Example: `CONCATENATE(first, " ", last)` gives "Ada Lovelace" when first is Ada and last is Lovelace

### CONTAINS

`CONTAINS(text, search)`

True when the text contains the search text, matching case exactly.

- `text` (text): The text to look in.
- `search` (text): The text to look for. Case matters. Empty search text is found in any text.
- Returns: a yes/no answer.
- Blank: A blank text or a blank search gives blank, so an unanswered question is neither a match nor a miss.
- Example: `CONTAINS(email, "@")` gives TRUE when email contains an @
- Deviation: Salesforce reads a blank field as TRUE here, so a validation rule passes on an empty answer. This language propagates the blank instead, by the blank rule (formula-language.md § Operators): an unanswered question must not report a match.

### PROPER

`PROPER(text)`

Capitalises the first letter of each word and lower-cases the rest. A letter after an apostrophe or a hyphen starts a word, so O'Neil and Smith-Jones keep their capitals.

- `text` (text): The text to recase.
- Returns: text.
- Blank: A blank text gives blank.
- Example: `PROPER("ada lovelace")` gives "Ada Lovelace"

### LEFT

`LEFT(text, count)`

The first characters of a text. Positions count characters from 1, one per Unicode code point, so an accented letter or an emoji is one.

- `text` (text): The text to cut from.
- `count` (a number): How many characters to keep. 0 keeps none and a count past the end keeps the whole text. A fraction here is cut to its whole part.
- Returns: text.
- Blank: A blank text or a blank count gives blank.
- Example: `LEFT(zip, 5)` gives the first five characters of zip
- Deviation: Salesforce reads a negative count as 0. This language reports it as a DOMAIN failure, by the governing principle: a negative count is a defect in the formula, not a request for empty text.

### MID

`MID(text, start, count)`

Characters from a position in a text. Positions count characters from 1, one per Unicode code point, so an accented letter or an emoji is one.

- `text` (text): The text to cut from.
- `start` (a number): The position of the first character to keep, counting from 1. A start past the end gives empty text. A fraction here is cut to its whole part.
- `count` (a number): How many characters to keep. 0 keeps none and a count past the end keeps the rest of the text. A fraction here is cut to its whole part.
- Returns: text.
- Blank: A blank text, a blank start or a blank count gives blank.
- Example: `MID("FA-12345", 4, 5)` gives "12345"
- Deviation: Salesforce reads a start before 1 as 1 and a negative count as 0. This language reports either as a DOMAIN failure, by the governing principle: a position outside the text is a defect in the formula, not a request for empty text.

### FIND

`FIND(search, text)`

The position of the search text in a text, or 0 when it is not there. Positions count characters from 1, one per Unicode code point, so an accented letter or an emoji is one.

- `search` (text): The text to look for. Case matters. Empty search text is found at position 1.
- `text` (text): The text to look in.
- Returns: a number.
- Blank: A blank search or a blank text gives blank, so an unanswered question is neither found nor missing.
- Example: `FIND("@", email)` gives the position of the first @ in email, or 0 when there is none
- Deviation: Salesforce reads a blank text as 0 here, so IF(FIND("@", Email) = 0, …) treats an unanswered question as a miss. This language propagates the blank instead, by the blank rule (formula-language.md § Operators): an unanswered question is neither found nor missing. The Salesforce reference does not say what an empty search gives; this entry follows Excel and finds it at position 1.

### SUBSTITUTE

`SUBSTITUTE(text, old, new)`

Replaces every occurrence of some text with other text, matching case exactly.

- `text` (text): The text to change.
- `old` (text): The text to replace, wherever it occurs. Case matters. Empty old text changes nothing.
- `new` (text): The text to put in its place; empty text removes it.
- Returns: text.
- Blank: A blank text, a blank old text or a blank new text gives blank.
- Example: `SUBSTITUTE(phone, "-", "")` gives phone with every hyphen removed

## Date and time

### LOCALTODAY

`LOCALTODAY()`

Today's date in the workflow's time zone, or the account's when the workflow sets none.

- Returns: a date.
- Blank: Takes no values, so it is never blank.
- Example: `LOCALTODAY()` gives today's date in the workflow's time zone

### TODAY

`TODAY()`

Today's date in UTC, whatever the time zone. Use LOCALTODAY for the date in the workflow's time zone.

- Returns: a date.
- Blank: Takes no values, so it is never blank.
- Example: `TODAY()` gives today's date in UTC
- Deviation: Salesforce and Excel read TODAY in the user's time zone; here it is the UTC date, and LOCALTODAY is the date in the workflow's zone, else the account's. Two names keep a zone-dependent date and a fixed one apart where the author can see which is which.

### LOCALNOW

`LOCALNOW()`

The current time of day in the workflow's time zone, or the account's when the workflow sets none. Pair it with LOCALTODAY for the date.

- Returns: a time.
- Blank: Takes no values, so it is never blank.
- Example: `LOCALNOW()` gives the current time of day in the workflow's time zone

### NOW

`NOW()`

The current time of day in UTC, whatever the time zone. Pair it with TODAY for the date. Use LOCALNOW for the time in the workflow's time zone.

- Returns: a time.
- Blank: Takes no values, so it is never blank.
- Example: `NOW()` gives the current time of day in UTC
- Deviation: Salesforce and Excel give NOW as a date and time in the user's time zone; here it is the time of day in UTC, because no value carries a date and a time together. TODAY gives the UTC date.

### YEAR

`YEAR(date)`

Gives the year of a date as a number.

- `date` (a date): The date to read the year from.
- Returns: a number.
- Blank: A blank date gives a blank number, as a blank operand does in arithmetic.
- Example: `YEAR(birthdate)` gives 1990 when birthdate is 1990-04-12

### MONTH

`MONTH(date)`

Gives the month of a date as a number, 1 for January through 12 for December.

- `date` (a date): The date to read the month from.
- Returns: a number.
- Blank: A blank date gives a blank number, as a blank operand does in arithmetic.
- Example: `MONTH(birthdate)` gives 4 when birthdate is 1990-04-12

### DAY

`DAY(date)`

Gives the day of the month of a date as a number, 1 to 31.

- `date` (a date): The date to read the day from.
- Returns: a number.
- Blank: A blank date gives a blank number, as a blank operand does in arithmetic.
- Example: `DAY(birthdate)` gives 12 when birthdate is 1990-04-12

### WEEKDAY

`WEEKDAY(date)`

Gives the day of the week of a date as a number, 1 for Sunday through 7 for Saturday.

- `date` (a date): The date to read the day of the week from.
- Returns: a number.
- Blank: A blank date gives a blank number, as a blank operand does in arithmetic.
- Example: `WEEKDAY(event_date)` gives 1 when event_date is 2026-11-08, a Sunday
- Deviation: Excel takes an optional second argument choosing which day the week starts on; this language has only the Sunday-first numbering, as Salesforce does.

### ADDDAYS

`ADDDAYS(date, days)`

Moves a date by a number of whole days, back when the count is negative.

- `date` (a date): The date to move.
- `days` (a number): How many whole days to move by. A negative count moves back. A fraction names no date and is an error.
- Returns: a date.
- Blank: A blank date or a blank days gives a blank date, as a blank operand does in arithmetic.
- Example: `ADDDAYS(start_date, 30)` gives the date 30 days after start_date
- Deviation: Excel and Salesforce let a date take + and - directly; this language refuses the operator and spells the unit in the name (formula-language.md § Operators). A fractional count is an error here, where both references cut it to a whole number.

### DAYSBETWEEN

`DAYSBETWEEN(start, end)`

Counts the whole days from a start date to an end date, negative when the end is earlier.

- `start` (a date): The date to count from.
- `end` (a date): The date to count to.
- Returns: a number.
- Blank: A blank start or a blank end gives a blank number, as a blank operand does in arithmetic.
- Example: `DAYSBETWEEN(start_date, end_date)` gives 10 when start_date is 2026-11-01 and end_date is 2026-11-11
- Deviation: Excel and Salesforce let one date be subtracted from another; this language refuses the operator and spells the unit in the name (formula-language.md § Operators).

### ADDMONTHS

`ADDMONTHS(date, months)`

Moves a date by a number of calendar months, back when the count is negative. A month's last day lands on the target month's last day, and a day the target month lacks becomes its last day.

- `date` (a date): The date to move.
- `months` (a number): How many whole months to move by. A negative count moves back. A fraction names no date and is an error.
- Returns: a date.
- Blank: A blank date or a blank months gives a blank date, as a blank operand does in arithmetic.
- Example: `ADDMONTHS(start_date, 1)` gives 2028-03-31 when start_date is 2028-02-29
- Deviation: A fractional count is an error here, where Salesforce cuts it to a whole number. The last-day rule is Salesforce's: a month's last day lands on the target month's last day, so 29 February plus one month is 31 March. Excel's EDATE keeps the day number where the target month has it, giving 29 March.

### YEARSBETWEEN

`YEARSBETWEEN(start, end)`

Counts the whole years completed from a start date to an end date, as an age is counted; negative when the end is earlier.

- `start` (a date): The date to count from, such as a birthdate.
- `end` (a date): The date to count to.
- Returns: a number.
- Blank: A blank start or a blank end gives a blank number, as a blank operand does in arithmetic.
- Example: `YEARSBETWEEN(birthdate, LOCALTODAY())` gives a person's age in whole years
- Deviation: Excel's DATEDIF(start, end, "Y") counts the same completed years but refuses an end before the start; here the count is negative instead, as DAYSBETWEEN is. A 29 February start completes a year on 1 March in a year with no 29 February.

## Deviation register

Every intentional difference from the Salesforce or Excel function of the same name, with the reason.

- [AND](#and): Stops at the first condition that is not true, so a later one never runs: AND(qty > 0, total / qty > 5) is FALSE when qty is 0, not an error. Excel and FormAssembly Classic work out every condition.
- [OR](#or): Stops at the first true condition, so a later one never runs and its error cannot surface. Excel and FormAssembly Classic work out every condition.
- [ROUND](#round): Excel reads a blank cell as 0 here; this language propagates the blank instead, because a substituted zero cannot be told from a computed one (formula-language.md § Operators).
- [ISBLANK](#isblank): Empty text is blank, so ISBLANK of a text field the respondent cleared, or of a text expression that works out to "", is TRUE — as Salesforce reads it. Excel treats a cell holding "" as occupied, because it was written to; a form has no such state, and that answer would be FALSE for exactly the case an author reaches for.
- [CONTAINS](#contains): Salesforce reads a blank field as TRUE here, so a validation rule passes on an empty answer. This language propagates the blank instead, by the blank rule (formula-language.md § Operators): an unanswered question must not report a match.
- [LEFT](#left): Salesforce reads a negative count as 0. This language reports it as a DOMAIN failure, by the governing principle: a negative count is a defect in the formula, not a request for empty text.
- [MID](#mid): Salesforce reads a start before 1 as 1 and a negative count as 0. This language reports either as a DOMAIN failure, by the governing principle: a position outside the text is a defect in the formula, not a request for empty text.
- [FIND](#find): Salesforce reads a blank text as 0 here, so IF(FIND("@", Email) = 0, …) treats an unanswered question as a miss. This language propagates the blank instead, by the blank rule (formula-language.md § Operators): an unanswered question is neither found nor missing. The Salesforce reference does not say what an empty search gives; this entry follows Excel and finds it at position 1.
- [TODAY](#today): Salesforce and Excel read TODAY in the user's time zone; here it is the UTC date, and LOCALTODAY is the date in the workflow's zone, else the account's. Two names keep a zone-dependent date and a fixed one apart where the author can see which is which.
- [NOW](#now): Salesforce and Excel give NOW as a date and time in the user's time zone; here it is the time of day in UTC, because no value carries a date and a time together. TODAY gives the UTC date.
- [WEEKDAY](#weekday): Excel takes an optional second argument choosing which day the week starts on; this language has only the Sunday-first numbering, as Salesforce does.
- [ADDDAYS](#adddays): Excel and Salesforce let a date take + and - directly; this language refuses the operator and spells the unit in the name (formula-language.md § Operators). A fractional count is an error here, where both references cut it to a whole number.
- [DAYSBETWEEN](#daysbetween): Excel and Salesforce let one date be subtracted from another; this language refuses the operator and spells the unit in the name (formula-language.md § Operators).
- [ADDMONTHS](#addmonths): A fractional count is an error here, where Salesforce cuts it to a whole number. The last-day rule is Salesforce's: a month's last day lands on the target month's last day, so 29 February plus one month is 31 March. Excel's EDATE keeps the day number where the target month has it, giving 29 March.
- [YEARSBETWEEN](#yearsbetween): Excel's DATEDIF(start, end, "Y") counts the same completed years but refuses an end before the start; here the count is negative instead, as DAYSBETWEEN is. A 29 February start completes a year on 1 March in a year with no 29 February.
