How-toUpdated Oct 16, 20264 min read

Work things out with a Formula field

Add a Formula field that works out a value from each record's other fields, such as a total, a days-left count or a label, and see every function you can use.

Add a field of type Formula and type a formula such as {Price} * {Quantity}. Each record shows the result, worked out from its own fields, and it updates as the fields change.

  1. Step 1: Click + at the end of the table's header row and choose Formula.
  2. Step 2: Name the field.
  3. Step 3: Type the formula. Put field names in curly braces, like {Due}, and text in quotes, like "Ready". Typing { lists the fields; typing a word suggests fields and functions.
  4. Step 4: Check the Result line under the box. Use Previous record and Next record to try the formula on other records.
  5. Step 5: Under Show the result as, keep Auto or pick Number, Text, Date or Checkbox, then click Create.
1

Below the box, Insert a field adds a field with one click, and Functions lists every function with how to use it. While you type inside a function, its inputs show with the current one highlighted. Press Cmd+Enter (or Ctrl+Enter) to save.

Examples

FormulaGives
{Price} * {Quantity}A total
IF({Status} = "Approved", "Go", "Wait")"Go" once the record is approved
DATETIME_DIFF({Due}, TODAY(), "days")Days left until the due date
DATETIME_FORMAT({Publish date}, "MMMM")The month's name, such as "October"
{Title} & " · " & {Target keyword}Two text fields joined
ROUND({Done} / {Total} * 100, 0)A share as a whole-number percent

What you can write

  • Fields: {Field name}. Case and extra spaces don't matter. A one-word name also works without braces.
  • Text: "text" or 'text'.
  • Numbers and true/false: 1.5, TRUE, FALSE (no brackets after TRUE and FALSE).
  • Math: + - * / % ^. Dividing by 0 or an empty field gives an empty result.
  • Join text: &. + also joins when one side is text.
  • Compare: = != <> < > <= >=. Text comparisons ignore case.

Functions

GroupFunctions
LogicIF, IFS, SWITCH, AND, OR, XOR, NOT, ISEMPTY, IFERROR, ISERROR, BLANK, ERROR
NumbersSUM, AVERAGE, MIN, MAX, ROUND, ROUNDUP, ROUNDDOWN, FLOOR, CEILING, ABS, INT, MOD, POWER, SQRT, EVEN, ODD, LOG, EXP, VALUE, COUNT, COUNTA, COUNTALL
TextCONCATENATE, LEN, UPPER, LOWER, TRIM, LEFT, RIGHT, MID, CONTAINS, FIND, SEARCH, SUBSTITUTE, REPLACE, REPT, T, REGEX_MATCH, REGEX_EXTRACT, REGEX_REPLACE, ENCODE_URL_COMPONENT
DatesTODAY, NOW, DATEADD, DATETIME_DIFF, WORKDAY, WORKDAY_DIFF, TONOW, DATETIME_FORMAT, DATETIME_PARSE, YEAR, MONTH, DAY, WEEKDAY, WEEKNUM, IS_BEFORE, IS_AFTER, IS_SAME, CREATED_TIME, LAST_MODIFIED_TIME

Date functions take a unit in quotes: "days", "weeks", "months", "years", "hours", "minutes" or "seconds". DATETIME_FORMAT takes a pattern such as "YYYY-MM-DD", or one of "friendly", "iso", "us", "eu" and "month". WEEKDAY counts Sunday as 0.

Some familiar names work too: CONCAT, LENGTH, TONUMBER, ISBLANK, MEAN, CEIL and POW.

What each field gives a formula

  • Single Select (batches included) and Multiple Select: the option names, joined with ", ".
  • Number, Progress, Checkbox and Date: their values.
  • Checklist: the percent done, 0 to 100.
  • Long Text: its text.
  • Media: the file names.
  • Approval: "Approved", "Revision", or empty.
  • Person, Relation and Publishing give ids rather than names, so they're not much use in a formula yet.

How the result shows

  • Number shows the full number settings: style, decimals and separators. A number with no format of its own takes the format of the first Number field it uses.
  • With Percent, 25 shows as 25%. For a share like {Done} / {Total}, multiply by 100.
  • Date has the date styles plus Show as chip and Include time.
  • When none of the fields a formula reads are filled in, the cell stays blank rather than showing 0.

If something looks wrong

  • The cell says Error: hover it to read why, then fix the formula in the field's settings. The message names the problem, such as "This field name is missing its closing }" or There's no field called "X". Did you mean {Y}?.
  • "Formulas reference each other in a loop": two formula fields use each other. A formula can use other formula fields, but not itself, directly or through others.
  • A field was renamed: formulas follow the new name on their own.

Related articles.

Still stuck?

Send the team a message and we'll help.