Skip to main content

Overview

Formulas let you create computed columns that automatically calculate values based on other columns. If you’ve used Excel or Google Sheets, the syntax will feel familiar.

Creating a Formula Column

  1. Click Add Column in your dataset
  2. Select Formula
  3. Enter your formula expression
  4. Name the new column
  5. Click Create

Syntax Basics

Referencing Columns

Wrap column names in double curly braces:
{{first_name}} + " " + {{last_name}}
Column names are case-sensitive and should match exactly:
{{First Name}} + " " + {{Last Name}}

Operators

OperatorDescriptionExample
+Add / Concatenate{{price}} + {{tax}}
-Subtract{{total}} - {{discount}}
*Multiply{{quantity}} * {{price}}
/Divide{{total}} / {{count}}
%Modulo{{id}} % 2
=Equals{{status}} = "active"
!=Not equals{{status}} != "deleted"
> < >= <=Comparison{{age}} >= 18
ANDLogical and{{active}} AND {{verified}}
ORLogical or{{role}} = "admin" OR {{role}} = "moderator"
NOTLogical notNOT({{deleted}})

Functions Reference

Text Functions

Convert text to uppercase.
UPPER("hello") → "HELLO"
UPPER({{name}}) → "JOHN DOE"
Convert text to lowercase.
LOWER("HELLO") → "hello"
Remove leading and trailing whitespace.
TRIM("  hello  ") → "hello"
Join multiple values together.
CONCAT({{first_name}}, " ", {{last_name}}) → "John Doe"
Get the first n characters.
LEFT("Hello World", 5) → "Hello"
Get the last n characters.
RIGHT("Hello World", 5) → "World"
Extract a substring.
MID("Hello World", 7, 5) → "World"
Get the length of text.
LEN("Hello") → 5
Replace occurrences of a string.
REPLACE("Hello World", "World", "Universe") → "Hello Universe"
Find the position of a substring within text. Returns the 1-based index of the first occurrence, or 0 if not found.
FIND("@", "[email protected]") → 5
FIND("world", "hello world") → 7
FIND("xyz", "hello") → 0

Math Functions

Add multiple values.
SUM({{price}}, {{tax}}, {{shipping}}) → 125.50
Calculate the average.
AVG({{q1}}, {{q2}}, {{q3}}, {{q4}}) → 87.5
Find the minimum value.
MIN({{price_a}}, {{price_b}}, {{price_c}}) → 9.99
Find the maximum value.
MAX({{score_1}}, {{score_2}}, {{score_3}}) → 98
Round to specified decimal places.
ROUND(3.14159, 2) → 3.14
Round down to nearest integer.
FLOOR(3.7) → 3
Round up to nearest integer.
CEIL(3.2) → 4
Get absolute value.
ABS(-42) → 42

Logic Functions

Conditional logic.
IF({{score}} >= 90, "A", IF({{score}} >= 80, "B", "C"))
Returns true if all conditions are true.
AND({{age}} >= 18, {{verified}} = true) → true/false
Returns true if any condition is true.
OR(role = "admin", role = "moderator") → true/false
Negate a boolean value.
NOT({{deleted}}) → true/false
Check if a value is null or empty.
ISBLANK({{phone}}) → true/false
Return the first non-null value.
COALESCE({{nickname}}, {{first_name}}, "Unknown") → "John"

Date Functions

Current date and time.
NOW() → "2024-01-15T10:30:00Z"
Current date (no time).
TODAY() → "2024-01-15"
Extract the year from a date.
YEAR({{created_at}}) → 2024
Extract the month (1-12).
MONTH({{created_at}}) → 1
Extract the day of month (1-31).
DAY({{created_at}}) → 15
Calculate difference between dates.
DATEDIFF(end_date, start_date, "days") → 30
Units: “years”, “months”, “days”, “hours”, “minutes”
Add time to a date.
DATEADD({{created_at}}, 30, "days") → date + 30 days

Examples

Calculate Age

DATEDIFF(TODAY(), {{birth_date}}, "years")

Full Name with Title

IF(ISBLANK({{title}}),
   {{first_name}} + " " + {{last_name}},
   {{title}} + " " + {{first_name}} + " " + {{last_name}})

Email Domain

RIGHT({{email}}, LEN({{email}}) - FIND("@", {{email}}))

Order Total with Tax

ROUND({{subtotal}} * (1 + {{tax_rate}}), 2)

Status Label

IF({{status}} = "active", "Active",
   IF({{status}} = "pending", "Pending",
      IF({{status}} = "inactive", "Inactive", "Unknown")))

Error Handling

Formulas handle errors gracefully:
SituationResult
Null value in calculationUsually null (unless using COALESCE)
Division by zeronull
Invalid function argumentsnull with warning
Type mismatchAttempted coercion, null if fails
Use COALESCE() to provide default values when dealing with potentially null columns.