Formulas: IF/THEN Logic

Formulas: IF/THEN Logic

How to write IF/THEN conditional logic in Layer formulas, including AND/OR operators, nested IFs, and the IFS function.

Mike Lee

Thursday, May 7, 2026

Layer formula fields support conditional logic through the IF function. IF returns one value when a condition is true and another when it is false. This article covers the basic syntax, the comparison functions used to build conditions, and how to express multi-branch logic through nested IF statements.

Basic syntax

IF(condition, value_if_true, value_if_false)

All three arguments are required. To leave the false branch empty, pass an empty string.

IF(EQUALS({Status}, "Approved"), "Ready", "")

This returns "Ready" when the Status field equals "Approved" and a blank value otherwise.

Building conditions

The condition argument is a boolean expression. Layer formula v2 builds conditions through dedicated comparison functions rather than infix operators such as = or <. The comparison functions used most often inside IF are listed below.

Function

Description

EQUALS(value1, value2)

TRUE when both values are equal and of the same type

NOTEQUALS(value1, value2)

TRUE when the values are different

GT(value1, value2)

TRUE when value1 is greater than value2

GTE(value1, value2)

TRUE when value1 is greater than or equal to value2

LT(value1, value2)

TRUE when value1 is less than value2

LTE(value1, value2)

TRUE when value1 is less than or equal to value2

DATEISBEFORE(date1, date2)

TRUE when date1 is earlier than date2

DATEISAFTER(date1, date2)

TRUE when date1 is later than date2

DATEISSAME(date1, date2)

TRUE when both dates are identical

EQUALS is strict on type. EQUALS("5", 5) returns FALSE because the first value is a string and the second is a number.

Examples

Flag an element as overdue when its due date has passed.

IF(DATEISBEFORE({Due Date}, NOW()), "Overdue", "On track")

Return a status label based on a numeric threshold.

IF(GTE({Progress}, 100), "Complete", "In progress")

Compare two fields rather than a field and a constant.

IF(LTE({Cost}, {Budget}), "Within budget", "Over budget")

Multiple conditions

Layer formula v2 expresses multiple conditions through nested IF statements. Use the true or false slot of the outer IF to host an inner IF.

Both conditions must be true

To require two conditions, nest the second IF inside the true branch of the first. The outer condition is checked first, and the inner condition is only checked when the outer one is true.

IF(DATEISBEFORE({Due Date}, NOW()),
  IF(NOTEQUALS({Status}, "Closed"), "Overdue", ""),
  "")

This returns "Overdue" only when the due date has passed and the status is not "Closed".

Either condition can be true

To accept either of two conditions, nest the second IF inside the false branch of the first. The outer condition runs first, and the inner condition gets a chance to return the value when the outer one is false.

IF(EQUALS({Priority}, "Critical"),
  "Escalate",
  IF(EQUALS({Priority}, "High"), "Escalate", ""))

This returns "Escalate" when the priority is either "Critical" or "High".

Three or more outcomes

Continue nesting IF statements to handle more than two outcomes.

IF(EQUALS({Progress}, 100), "Complete",
  IF(GTE({Progress}, 50), "In progress",
    IF(GT({Progress}, 0), "Started", "Not started")))

The branches evaluate in order. The first condition that returns true determines the output.

Things to know

Comparison functions are case-sensitive and type-strict. EQUALS({Status}, "approved") will not match a Status value of "Approved". Match the exact capitalisation of the option name. EQUALS({Quantity}, "5") will not match the number 5. Use number comparisons for number fields.

There is no IFS, IFERROR, or ISBLANK function in Layer formula v2. Use nested IF for multi-branch logic. To handle a possibly empty field, compare it explicitly: IF(EQUALS({Field}, ""), "default", {Field}).

Nesting depth. Deeply nested IF chains become hard to read past three or four levels. If you find yourself nesting heavily, consider whether the value belongs in a Lookup field with an aggregation, or whether it can be set on the element directly through an Automation.

Field references in the visual editor. Conditions in the visual formula editor are built by inserting comparison functions and dragging fields into the parameter slots. The {Field Name} notation in the examples above is shorthand for communicating structure in writing.

Additional resources