Writing formulas

General Caster formulas use the syntax of Microsoft Excel, with column references in place of cells.

Syntax

If you know Excel, you already know it. A formula combines values, operators and functions:

  • numbers: 42, 3.14 (always with a dot as decimal separator);
  • text in double quotes: "Done";
  • operators: + - * / ^ for math, & to join text, = <> < > <= >= to compare;
  • functions with arguments separated by commas: ROUND({item's Price} * 1.22, 2). All 440+ functions are in the Function reference.

The leading = of Excel is optional.

Column references

A reference like {item's Price} is replaced with the value of that column of the item, in the format described in Column values.

Don't type references by hand: in the formula editor click the button of the column at the bottom, and the right reference is inserted for you. Formulas copied from these pages or from the Ideas need their references replaced the same way.

Give columns unique names

monday.com lets two columns have the same name. If a formula refers to a name used twice, General Caster can't know which one you mean. Rename the columns so that each name is unique.

Besides the columns, a formula can use the board name, the group of the item and the name of the user who triggered the change: {board.name}, {group.name} and {user.name}.

Text or number?

Each column value is placed in a spreadsheet cell, just as if you typed it in Excel: numbers become numbers, everything else is text. Dates stay text in YYYY-MM-DD format, so convert them with DATEVALUE before adding days: see Dates and times.

To compare with a label, use quotes: IF({item's Status} = "Done", 1, 0).

Leave the column unchanged: DO-NOTHING

Sometimes the target should change only when a condition is true. Return the text DO-NOTHING and General Caster leaves the target column as it is, without writing anything.

IF({item's Status} = "Done", "Completed", "DO-NOTHING")

The target becomes "Completed" only when the status is set to Done; in any other case the current value stays.

Loops and chains

A formula can't write into a column it reads: General Caster stops it with the error "No loop allowed". To build on a result, chain two recipes on different columns, for example:

  1. When Date changes, perform formula and cast result to Days left;
  2. When Days left changes, perform formula and cast result to Status.

Watch out for longer loops (A writes B, B writes A): they consume operations without end. See Plans and operations.

Error values

When a formula can't produce a result, it returns an Excel error value, and that becomes the result: a Text column shows it, while other column types reject it and General Caster notifies you on the item. Errors are also listed in the Console.

ErrorMeaningHow to fix it
#DIV/0!Division by zero or by an empty column.Wrap the formula in IFERROR(..., "") or check the divisor with IF.
#NAME?A function name is misspelled or doesn't exist.Check the spelling against the Function reference.
#NUM!A number is invalid for the function, like the square root of a negative number.Check the values the function receives.
#VALUE!A value has the wrong type, often a date used in math without conversion, or an empty column.Convert with DATEVALUE or VALUE, and handle empty columns with IF.
#N/AA lookup found nothing.Use IFNA or IFERROR to return a fallback.

Something unclear or missing? Tell us and we'll improve this page.