How to use the Formula field

The Formula field type allows you to create calculated fields using predefined formulas and variables.

Formulas

🔢Math
FunctionDescriptionSyntaxExample
ABSAbsolute valueABS(num1)ABS(-1) = 1
DIVIDEDivisionDIVIDE(num1, num2)DIVIDE(10, 2) = 5
MAXMaximum valueMAX(num1, num2, ...)MAX(1, 5, 3) = 5
MINMinimum valueMIN(num1, num2, ...)MIN(1, 5, 3) = 1
MODModulo (remainder)MOD(num1, num2)MOD(10, 3) = 1
MULTIPLYMultiplicationMULTIPLY(num1, num2)MULTIPLY(3, 4) = 12
ROUNDRound to nearest integerROUND(num, digits)ROUND(3.7) = 4
ROUNDDOWNRound downROUNDDOWN(num, digits)ROUNDDOWN(3.7) = 3
ROUNDUPRound upROUNDUP(num, digits)ROUNDUP(3.2) = 4
SUBTRACTSubtractionSUBTRACT(num1, num2)SUBTRACT(10, 3) = 7
SUMSum of valuesSUM(num1, num2, ...)SUM(1, 2, 3) = 6

📝Text
FunctionDescriptionSyntaxExample
CONCATConcatenate textCONCAT(text1, text2, ...)CONCAT("Hello", " ", "World") = "Hello World"
LEFTExtract leftmost charactersLEFT(text, num)LEFT("Hello", 2) = "He"
LENLength of textLEN(text)LEN("Hello") = 5
LOWERConvert to lowercaseLOWER(text)LOWER("HELLO") = "hello"
MIDExtract middle charactersMID(text, start, num)MID("Hello", 2, 3) = "ell"
PROPERConvert to proper casePROPER(text)PROPER("hello world") = "Hello World"
REPLACEReplace textREPLACE(text, start, num, new)REPLACE("Hello", 2, 2, "a") = "Halo"
RIGHTExtract rightmost charactersRIGHT(text, num)RIGHT("Hello", 2) = "lo"
TRIMRemove extra spacesTRIM(text)TRIM(" Hello ") = "Hello"
UPPERConvert to uppercaseUPPER(text)UPPER("hello") = "HELLO"

📅Date & Time
FunctionDescriptionSyntaxExample
DATECreate a dateDATE(year, month, day)DATE(2024, 1, 15) = 1/15/2024
DATEDIFDifference between datesDATEDIF(date1, date2, unit)DATEDIF(DATE(2024,1,1), DATE(2024,12,31), "D") = 365
DAYExtract dayDAY(date)DAY(DATE(2024, 1, 15)) = 15
EDATEAdd months to dateEDATE(date, months)EDATE(DATE(2024, 1, 15), 3) = 4/15/2024
EOMONTHEnd of monthEOMONTH(date, months)EOMONTH(DATE(2024, 1, 15), 0) = 1/31/2024
HOURExtract hourHOUR(time)HOUR(TIME(14, 30, 0)) = 14
MINUTEExtract minuteMINUTE(time)MINUTE(TIME(14, 30, 0)) = 30
MONTHExtract monthMONTH(date)MONTH(DATE(2024, 1, 15)) = 1
NOWCurrent date and timeNOW()NOW() = 1/15/2024 2:30 PM
TIMECreate a timeTIME(hour, minute, second)TIME(14, 30, 0) = 2:30 PM
TODAYCurrent dateTODAY()TODAY() = 1/15/2024
WEEKDAYDay of weekWEEKDAY(date)WEEKDAY(DATE(2024, 1, 15)) = 2
WEEKNUMWeek numberWEEKNUM(date)WEEKNUM(DATE(2024, 1, 15)) = 3
YEARExtract yearYEAR(date)YEAR(DATE(2024, 1, 15)) = 2024

⚙️Logic
FunctionDescriptionSyntaxExample
ANDLogical ANDAND(condition1, condition2, ...)AND(TRUE, TRUE) = TRUE
IFConditional statementIF(condition, value_if_true, value_if_false)IF(5 > 3, "Yes", "No") = "Yes"
IFSMultiple conditionsIFS(condition1, value1, condition2, value2, ...)IFS(5 > 10, "A", 5 > 3, "B") = "B"
NOTLogical NOTNOT(condition)NOT(TRUE) = FALSE
ORLogical OROR(condition1, condition2, ...)OR(TRUE, FALSE) = TRUE
SWITCHSwitch between valuesSWITCH(value, case1, result1, case2, result2, ...)SWITCH(2, 1, "A", 2, "B") = "B"
XORExclusive ORXOR(condition1, condition2)XOR(TRUE, FALSE) = TRUE

🔍Comparison
FunctionDescriptionSyntaxExample
EQEqual toEQ(value1, value2)EQ(5, 5) = TRUE
GTGreater thanGT(value1, value2)GT(5, 3) = TRUE
GTEGreater than or equal toGTE(value1, value2)GTE(5, 5) = TRUE
LTLess thanLT(value1, value2)LT(3, 5) = TRUE
LTELess than or equal toLTE(value1, value2)LTE(5, 5) = TRUE

📊Stats
FunctionDescriptionSyntaxExample
AVERAGEAverage valueAVERAGE(num1, num2, ...)AVERAGE(1, 2, 3) = 2
COUNTCount non-empty valuesCOUNT(value1, value2, ...)COUNT(1, 2, "", 4) = 3
MEDIANMedian valueMEDIAN(num1, num2, ...)MEDIAN(1, 2, 3) = 2
COUNTEMPTYCount empty valuesCOUNTEMPTY(value1, value2, ...)COUNTEMPTY(1, "", 3, "") = 2

Variables

Variables return the value of a field for each entry. You can reference any field in your formula using variables. Both variables and formulas can be added automatically via the available buttons in the Write Formula section.

Formula Examples

Here are some practical examples of formulas using available functions and variables:

Formula NameFormulaDescription
Calculate total priceMULTIPLY({Price}, {Quantity})Multiplies the Price field by the Quantity field
Format full nameCONCAT({First Name}, " ", {Last Name})Combines first and last name fields with a space
Calculate ageDATEDIF({Date of Birth}, TODAY(), "Y")Calculates years between birth date and today
Conditional discountIF(GT({Order Total}, 100), MULTIPLY({Order Total}, 0.9), {Order Total})Applies 10% discount if order total exceeds 100
Extract area codeLEFT({Phone Number}, 3)Extracts the first 3 characters from a phone number field
Calculate average ratingAVERAGE({Rating 1}, {Rating 2}, {Rating 3})Finds the average of multiple rating fields
Status based on dateIF(LT({Due Date}, TODAY()), "Overdue", "On Track")Marks items as overdue if due date has passed
Combine and format textUPPER(CONCAT({Department}, " - ", {Project Name}))Creates an uppercase combined field

Creating a Formula Field

  1. When creating a new field, choose Formula as the data type
  2. The Write Formula section will appear
  3. Write your formula using available functions and variables
  4. Both variables and formulas can be added automatically via the available buttons

Adding to Entry Layout

After creating your formula field, you can add it to the entry layout so it appears in the system. For more information, refer to Creating Fields.


Did this page help you?