Formula field

Who can use this feature?

👤  Available on all plans

Formulas let you transform and combine existing fields into a new Formula field. For example, you can:

  • Concatenate First name and Last name fields into a Full name Formula field. 
  • Multiply Price and Units field to get the result in the Revenue Formula field.

The field will show only in your Stacker app, and won't show up in your Airtable base or Google Sheets.

Create a formula field

  1. Go to App Settings > [Table name] > Fields
  2. Click Add field > Formula
  3. Type in your formula
  4. Click Save

Press space in the formula field box to see a list of all available fields and functions.

Fields in formulas

To use a field in a formula, the field needs to be in the table where you're creating the formula field. It also needs to be one of the following data types:

  • Text
  • Long Text
  • Number
  • Checkbox
  • URL
  • Single Select Dropdown
  • Percentage
  • Currency

To use a field in a formula, you will need to wrap it in curly brackets. For example, {Price}. If you type in the opening curly bracket, we will suggest all available fields.

Screenshot_2022-03-31_at_16.06.25.png

List of formulas

Functions work with any valid field data types, while operators work only on number fields. If you use an operator for a non-number field, we will try to convert it into a number. If we can't, you'll see an error message.

 

Type Name Description Syntax Examples
Function CONCAT Concatenate two values.

CONCAT( , )

or

&

CONCAT("Hello ", {Fullname}, " !")

or

"Hello " & {Fullname} & " !"

Function Condition

Check whether the statement is true. If it is true, then do Action A. If it is false, then do Action B.


IF(statement, Action A, Action B) IF({UserId}, "https://dashboard.com/" + {UserId}, "")
Operator SUM

Returns the sum of two or more numbers.

SUM( , )

or

+

SUM({Sold},{Not sold})

or

{Sold} + {Not sold}

Operator Subtract

Returns the difference of two numbers.

- {Total stock} - {Sold stock}
Operator Multiply

Returns the product of two numbers.

* {Sold} * {Price}
Operator Divide

Returns one number divided by another.

/ {Total sold} / {Price}
Operator Average

Returns the average of the values in two or more fields.

AVERAGE( , ) AVERAGE({Sold},{Not sold})

Error messages

If a formula is invalid, you will see an error message that might help you understand what went wrong.

 

Error Meaning
Missing formula function or Unexpected formula function Means that you were very creative, but we don't have the formula function yet.
Function only works with field_type but field is a another_field_type Shows when using a field with an incompatible field type.
In an IF function, field_name and field_name_2 must be of similar types Shows in an IF function when the Action A and Action B are different types.
Missing keys in formula 'IF' function: else Means that there is a missing else (Action B) in the IF function.

Articles in this section