Formula Builder: Calculated Columns and Expressions
Build powerful calculated columns using column references, pipe chaining, and 70+ functions across String, Math, Date, Aggregation, Finance, and Geo categories.
Formula Builder: Calculated Columns and Expressions
The Formula Builder lets you create new columns from your data using expressions, functions, and math. No coding required—just point, click, and build.
What Is the Formula Builder?
The Formula Builder is a visual tool for writing expressions that compute new values from existing columns. For example, you can add a column that combines first and last name, or one that multiplies price by quantity.
Column Reference Syntax
To use a column in your formula, wrap its name in double hash marks:
#ColumnName#
Examples:
| Column Name | Reference |
|---|---|
| Sales | #Sales# |
| First Name | #First Name# |
| 2024 Revenue | #2024 Revenue# |
Pipe Chaining (>>)
Pipe chaining lets you pass the result of one expression into the next. Use >> between steps:
#FirstName# >> UPPER >> TRIM
This takes First Name, converts to uppercase, then trims spaces. Each step receives the output of the previous step.
All Function Categories
String Functions (25)
Text manipulation functions for names, labels, and descriptions.
| Function | What It Does | Example |
|---|---|---|
| UPPER | All uppercase | UPPER(#Name#) → "JOHN" |
| LOWER | All lowercase | LOWER(#Name#) → "john" |
| TRIM | Remove leading/trailing spaces | TRIM(#City#) |
| CONCAT | Join strings | CONCAT(#First#, " ", #Last#) |
| SUBSTRING | Extract part of text | SUBSTRING(#Code#, 1, 3) |
| REPLACE | Swap text | REPLACE(#Status#, "old", "new") |
| LENGTH | Count characters | LENGTH(#Name#) |
| LEFT / RIGHT | First or last N characters | LEFT(#Code#, 2) |
| SPLIT | Split by delimiter | SPLIT(#FullName#, " ") |
| PAD | Add padding | PAD(#ID#, 5, "0") |
| REVERSE | Reverse string | REVERSE(#Code#) |
| CONTAINS | Check if text exists | CONTAINS(#Desc#, "sale") |
| STARTSWITH | Check prefix | STARTSWITH(#Name#, "Mr") |
| ENDSWITH | Check suffix | ENDSWITH(#Email#, ".com") |
| INDEXOF | Find position | INDEXOF(#Text#, "x") |
| REPEAT | Repeat string | REPEAT("-", 10) |
| TITLECASE | Capitalize each word | TITLECASE(#title#) |
| EXTRACT | Extract with regex | EXTRACT(#Text#, "\\d+") |
| REGEXREPLACE | Replace with pattern | REGEXREPLACE(#Code#, "\\s", "") |
| COALESCESTR | First non-empty | COALESCESTR(#A#, #B#, "default") |
CONCAT(TITLECASE(#FirstName#), " ", TITLECASE(#LastName#))
Math Functions (15)
Numeric calculations and transformations.
| Function | What It Does | Example |
|---|---|---|
| ADD | Sum | ADD(#A#, #B#) |
| SUBTRACT | Difference | SUBTRACT(#Revenue#, #Cost#) |
| MULTIPLY | Product | MULTIPLY(#Price#, #Qty#) |
| DIVIDE | Quotient | DIVIDE(#Total#, #Count#) |
| POWER | Exponentiation | POWER(#X#, 2) |
| SQRT | Square root | SQRT(#Area#) |
| ABS | Absolute value | ABS(#Difference#) |
| ROUND | Round to decimals | ROUND(#Price#, 2) |
| FLOOR / CEIL | Round down/up | FLOOR(#Amount#) |
| MIN / MAX | Smallest/largest | MIN(#A#, #B#, #C#) |
| LOG / LOG10 | Logarithm | LOG(#Value#, 10) |
| MOD | Remainder | MOD(#Count#, 10) |
| SIGN | +1, 0, or -1 | SIGN(#Change#) |
| CLAMP | Limit range | CLAMP(#Score#, 0, 100) |
ROUND(DIVIDE(SUBTRACT(#Revenue#, #Cost#), #Revenue#) 100, 2)
Date Functions (15)
Work with dates and times.
| Function | What It Does | Example |
|---|---|---|
| TODAY | Current date | TODAY() |
| NOW | Current date and time | NOW() |
| YEAR / MONTH / DAY | Extract parts | YEAR(#OrderDate#) |
| HOUR / MINUTE / SECOND | Time parts | HOUR(#TimeStamp#) |
| DATEADD | Add days/months/years | DATEADD(#Start#, 7, "days") |
| DATEDIFF | Difference between dates | DATEDIFF(#End#, #Start#, "days") |
| DATEFORMAT | Format as text | DATEFORMAT(#Date#, "YYYY-MM") |
| PARSEDATE | Text to date | PARSEDATE(#Str#, "MM/DD/YYYY") |
| STARTOFMONTH | First day of month | STARTOFMONTH(#Date#) |
| ENDOFMONTH | Last day of month | ENDOFMONTH(#Date#) |
| QUARTER | Quarter number | QUARTER(#Date#) |
| WEEKDAY | Day of week | WEEKDAY(#Date#) |
| DATEDIFFDAYS | Days between | DATEDIFFDAYS(#A#, #B#) |
ROUND(DATEDIFF(TODAY(), #BirthDate#, "days") / 365.25, 0)
Aggregation Functions (10)
Summarize values (often used with grouping).
| Function | What It Does | Example |
|---|---|---|
| SUM | Total | SUM(#Amount#) |
| AVG | Average | AVG(#Score#) |
| MIN / MAX | Smallest/largest | MAX(#Sales#) |
| COUNT | Count values | COUNT(#ID#) |
| COUNTDISTINCT | Unique count | COUNTDISTINCT(#Customer#) |
| MEDIAN | Middle value | MEDIAN(#Salary#) |
| STDDEV | Standard deviation | STDDEV(#Returns#) |
| FIRST / LAST | First or last value | LAST(#Price#) |
DIVIDE(#Amount#, SUM(#Amount#))100
Finance Functions (5)
Common financial calculations.
| Function | What It Does | Example |
|---|---|---|
| PV | Present value | PV(rate, periods, payment) |
| FV | Future value | FV(rate, periods, payment) |
| PMT | Loan payment | PMT(rate, periods, principal) |
| RATE | Interest rate | RATE(periods, payment, principal) |
| NPV | Net present value | NPV(rate, #CashFlows#) |
PMT(0.05/12, 360, 200000)
Geo Functions (1)
| Function | What It Does | Example |
|---|---|---|
| GEODISTANCE | Distance between coordinates | GEODISTANCE(lat1, lon1, lat2, lon2) |
20+ Practical Examples
- Full name:
CONCAT(#First#, " ", #Last#) - Email domain:
SPLIT(#Email#, "@") >> LAST - Profit:
SUBTRACT(#Revenue#, #Cost#) - Margin %:
ROUND(DIVIDE(SUBTRACT(#Revenue#, #Cost#), #Revenue#) * 100, 2) - Age group:
IF(#Age# < 30, "Young", IF(#Age# < 50, "Mid", "Senior")) - Quarter label:
CONCAT("Q", QUARTER(#Date#)) - Days since order:
DATEDIFF(TODAY(), #OrderDate#, "days") - Z-score:
DIVIDE(SUBTRACT(#Value#, AVG(#Value#)), STDDEV(#Value#)) - Padded ID:
PAD(#ID#, 6, "0") - Clean phone:
REGEXREPLACE(#Phone#, "[\\D]", "") - Boolean flag:
CONTAINS(#Status#, "active") ? 1 : 0 - Capped value:
MIN(#Sales#, 10000) - Percentile bin:
IF(#Score# >= 90, "A", IF(#Score# >= 80, "B", "C")) - Year-month:
DATEFORMAT(#Date#, "YYYY-MM") - First 3 chars:
LEFT(#Code#, 3) - Ratio:
DIVIDE(#A#, #B#, 0)(0 if B is null) - Log transform:
LOG(ADD(#Value#, 1), 10) - Normalized 0–1:
DIVIDE(SUBTRACT(#X#, MIN(#X#)), SUBTRACT(MAX(#X#), MIN(#X#))) - Trim and upper:
#Name# >> TRIM >> UPPER - Concat with pipe:
CONCAT(#A#, " | ", #B#, " | ", #C#)
Saving Formulas
- Build your formula in the Formula Builder.
- Name the new column (e.g., "Profit Margin").
- Click Apply or Create Column.
- The new column appears in your data grid.
What's Next?
- [Statistical Tests Guide](statistical-tests-guide) – Hypothesis testing
- [Math Operations Guide](math-operations-guide) – Built-in math transforms
- [Statistics Overview](statistics-overview) – Full statistics workflow
Related Articles
Statistics Overview: What Are Statistics and How to Use Them
A beginner-friendly introduction to statistics, descriptive vs inferential analysis, the Statistics workspace layout, and running your first analysis.
Data Operations Guide: All 15 Transformations Explained
A complete guide to all 15 data operations: label encode, one-hot encode, filter, transpose, rename, date conversion, concatenate, cross tab, rename factor, impute, grouping, drop duplicates, ignore column, delete missing, and data table view.
Math Operations Guide: All 12 Numeric Transformations
A complete guide to arithmetic, binning, log transform, power, round/ceil/floor, standardize, normalize, sign, Box-Cox/Yeo-Johnson, and cumulative operations.
Was this helpful?