Skip to main content

Formulas

Formula fields in Copera Boards let you create calculated columns that derive their values automatically from other data in your rows. Powered by the Copera Formula Engine -- a dedicated formula language with its own parser and evaluator -- you can build everything from simple arithmetic to complex conditional logic and date calculations.

Formula Language Overview

Copera formulas use a syntax similar to spreadsheet formulas. Each formula is evaluated per row, with access to all column values in that same row. The formula engine supports:

  • Arithmetic operators: +, -, *, / for math operations
  • String concatenation: & to join text values together
  • Comparison operators: =, !=, >, <, >=, <=
  • Logical operators: AND, OR, NOT for combining conditions
  • Field references: Reference other columns by wrapping the column name in curly braces, e.g., {Column Name}
  • Nested functions: Functions can be used as arguments to other functions

Basic Syntax

{Price} * {Quantity}

This formula multiplies the value of the "Price" column by the "Quantity" column for each row.

IF({Status} = "Done", "Complete", "Pending")

This formula returns "Complete" when the Status column equals "Done", and "Pending" otherwise.

Function Reference

The Copera Formula Engine provides over 100 functions organized into the following categories. Below is a reference of the most commonly used functions.

Math Functions

FunctionDescriptionExample
ABS(number)Absolute valueABS({Balance})
CEIL(number)Round up to nearest integerCEIL({Score} / 10)
FLOOR(number)Round down to nearest integerFLOOR({Price})
ROUND(number, decimals)Round to specified decimal placesROUND({Average}, 2)
MIN(a, b, ...)Smallest valueMIN({Estimate}, {Budget})
MAX(a, b, ...)Largest valueMAX({Score1}, {Score2})
SUM(a, b, ...)Sum of valuesSUM({Q1}, {Q2}, {Q3}, {Q4})
AVERAGE(a, b, ...)Arithmetic meanAVERAGE({Test1}, {Test2})
MOD(number, divisor)Remainder after divisionMOD({Row Number}, 2)
POWER(base, exponent)Raise to a powerPOWER({Side}, 2)
SQRT(number)Square rootSQRT({Area})

Text Functions

FunctionDescriptionExample
CONCAT(a, b, ...)Join text valuesCONCAT({First Name}, " ", {Last Name})
LEFT(text, count)Extract from startLEFT({Code}, 3)
RIGHT(text, count)Extract from endRIGHT({Phone}, 4)
MID(text, start, count)Extract from middleMID({ID}, 2, 4)
LEN(text)Character countLEN({Description})
LOWER(text)Convert to lowercaseLOWER({Email})
UPPER(text)Convert to uppercaseUPPER({Code})
TRIM(text)Remove leading/trailing spacesTRIM({Input})
REPLACE(text, old, new)Replace occurrencesREPLACE({URL}, "http", "https")
SEARCH(find, text)Find position of substringSEARCH("@", {Email})

Date Functions

The formula engine integrates with an extensive date library, giving you access to powerful date manipulation and comparison functions.

FunctionDescriptionExample
TODAY()Current dateTODAY()
NOW()Current date and timeNOW()
YEAR(date)Extract yearYEAR({Created})
MONTH(date)Extract month (1-12)MONTH({Due Date})
DAY(date)Extract day of monthDAY({Birthday})
WEEKDAY(date)Day of week (0-6)WEEKDAY({Start Date})
WEEKNUM(date)Week number of yearWEEKNUM({Created})
QUARTER(date)Quarter (1-4)QUARTER({Close Date})
DATEADD(date, count, unit)Add time to a dateDATEADD({Start}, 14, "days")
DATEDIFF(date1, date2, unit)Difference between datesDATEDIFF({Start}, {End}, "days")
IS_BEFORE(date1, date2)Check if date1 is before date2IS_BEFORE({Due Date}, TODAY())
IS_AFTER(date1, date2)Check if date1 is after date2IS_AFTER({Due Date}, TODAY())
IS_SAME_DAY(date1, date2)Check if same dayIS_SAME_DAY({Created}, TODAY())
IS_TODAY(date)Check if date is todayIS_TODAY({Due Date})
IS_WEEKEND(date)Check if date falls on weekendIS_WEEKEND({Delivery Date})
START_OF_MONTH(date)First day of monthSTART_OF_MONTH({Date})
END_OF_MONTH(date)Last day of monthEND_OF_MONTH({Date})
START_OF_WEEK(date)First day of weekSTART_OF_WEEK({Date})
END_OF_WEEK(date)Last day of weekEND_OF_WEEK({Date})
ADD_BUSINESS_DAYS(date, days)Add business days onlyADD_BUSINESS_DAYS({Start}, 5)
DIFF_BUSINESS_DAYS(d1, d2)Business days between datesDIFF_BUSINESS_DAYS({Start}, {End})

Logical Functions

FunctionDescriptionExample
IF(condition, then, else)Conditional valueIF({Amount} > 1000, "High", "Low")
SWITCH(expr, val1, result1, ...)Match against multiple valuesSWITCH({Priority}, "P0", "Critical", "P1", "High", "Normal")
AND(a, b, ...)True if all conditions are trueAND({Complete}, {Approved})
OR(a, b, ...)True if any condition is trueOR({Urgent}, {Overdue})
NOT(value)Invert a booleanNOT({Archived})
ISBLANK(value)Check if emptyISBLANK({Notes})

Common Formula Examples

Concatenating Names

CONCAT({First Name}, " ", {Last Name})

Combines first and last name columns with a space in between.

Calculating Days Until Due

DATEDIFF(TODAY(), {Due Date}, "days")

Returns the number of days remaining until the due date. Negative values indicate overdue items.

Conditional Status Labels

IF(IS_BEFORE({Due Date}, TODAY()), "Overdue",
IF(DATEDIFF(TODAY(), {Due Date}, "days") <= 3, "Due Soon", "On Track"))

Returns "Overdue" for past-due items, "Due Soon" for items due within 3 days, and "On Track" for everything else.

Percentage Calculation

ROUND({Completed Tasks} / {Total Tasks} * 100, 1)

Calculates completion percentage rounded to one decimal place.

Business Days Remaining

DIFF_BUSINESS_DAYS(TODAY(), {Deadline})

Calculates the number of working days (excluding weekends) between today and a deadline.

Error Handling

When a formula contains errors, Copera displays an error indicator in the cell instead of a value. Common errors include:

  • Syntax errors -- Mismatched parentheses, missing operators, or unrecognized function names.
  • Type mismatches -- Attempting to perform arithmetic on text values or date operations on numbers.
  • Null references -- Referencing a column that has no value in the current row. Use ISBLANK() to handle optional fields gracefully.
  • Division by zero -- Dividing by a column that contains zero. Wrap with an IF to check: IF({Total} = 0, 0, {Part} / {Total}).

The formula editor shows a live preview of the result as you type, making it easy to catch and fix errors before saving.

AI-Assisted Formula Creation

If you are unsure how to write a formula, Copera offers an AI-powered formula assistant. Describe what you want to calculate in natural language, and the assistant will generate a formula for you. You can review, edit, and refine the suggestion before applying it to your column.

Next Steps