Skip to content

Formula and Validation Rules reference ​

This reference lists the operators, functions, signatures, and examples supported by Validation Rules, Formula fields, and default-value formulas.

Overview ​

Use this reference to write Formula fields, default values, and Validation Rules. It covers supported Field Type values, operators, function parameters, and common expressions.

Supported field types ​

The formula engine supports:

  • Amount, percentage, decimal, and number.
  • Date, Date Time, and time.
  • Single-Line Text, Multi-Line Text, email, URL, address, and mobile number.
  • Boolean.
  • Location, Check-In, and payment components.
  • Formula and Roll-Up Summary.
  • Formula and Roll-Up Summary fields reached through a cross-object Lookup.

Operators and functions ​

Return typeOperator or functionParametersDescriptionExample
General()NoneChanges evaluation precedence.(3 + 2) * 5
GeneralIF(logical_test, value_if_true, value_if_false)Three; results must share a typeReturns the second value when true, otherwise the third.IF(true, 34, 52) returns 34
GeneralCASE(expression, value1, result1, ..., else_result)Variable; all results share a typeCompares in order and returns the matching result or fallback.CASE(3, 2, 2, 3, 33, 1.3) returns 33
GeneralNULLVALUE(expression, substitute_expression)TwoReturns the substitute when the expression is null.NULLVALUE(Null, 1) returns 1
Number+, -, *, /Two numeric valuesPerforms arithmetic.(3 + 2) * 6 / 5 returns 6
NumberDate - dateTwo datesReturns the difference in days.End Date minus Start Date
NumberDate-time - date-timeTwo date-timesReturns the difference in hours.Two timestamps
NumberTime - timeTwo timesReturns the difference in hours.17:00:00 - 15:00:00 returns 2
NumberVALUE(string)TextConverts text to a number or returns Null.VALUE('-1982.0413')
NumberMIN(number1, number2)Two numbersReturns the smaller number.MIN(4, 13) returns 4
NumberMAX(number1, number2)Two numbersReturns the larger number.MAX(4, 13) returns 13
NumberMULTIPLE(number1, number2)Two numbersMultiplies two numbers.MULTIPLE(4, 13) returns 52
NumberMOD(number1, number2)Two numbersReturns the remainder.MOD(13, 4) returns 1
NumberADDS(number1, number2)Two numbersAdds two numbers.ADDS(13, 4) returns 17
NumberSUBTRACTS(number1, number2)Two numbersSubtracts the second number.SUBTRACTS(13, 4) returns 9
NumberYEAR(date)Date or Date TimeReturns the year.YEAR(DATEVALUE('1982-04-13'))
NumberMONTH(date)Date or Date TimeReturns the month.MONTH(DATEVALUE('1982-04-13'))
NumberDAY(date)Date or Date TimeReturns the day of month.DAY(DATEVALUE('1982-04-13'))
NumberLEN(text)TextReturns character count.LEN('xiaoke') returns 6
DurationYEARS(number)NumberCreates a year offset.TODAY() + YEARS(1)
DurationMONTHS(number)NumberCreates a month offset.TODAY() + MONTHS(2)
DurationDAYS(number)NumberCreates a day offset.TODAY() - DAYS(7)
DurationHOURS(number)NumberCreates an hour offset.NOW() + HOURS(4)
DurationMINUTES(number)NumberCreates a minute offset.NOW() - MINUTES(30)
Date+, -Date and offsetAdds or subtracts an offset.Created On plus four days
DateDATE(year, month, day)Three numbersConstructs a date.DATE(1982, 4, 13)
DateDATEVALUE(string)TextParses a date.DATEVALUE('1982-04-13')
DateTODAY()NoneReturns the current date.2026-07-02
DateDATETIMETODATE(datetime)Date TimeExtracts the date.DATETIMETODATE(NOW())
Date Time+, -Date Time and offsetAdds or subtracts an offset.Deadline minus one day
Date TimeDATETIMEVALUE(string)TextParses a Date Time.DATETIMEVALUE('2001-08-24 15:45:25')
Date TimeNOW()NoneReturns the current Date Time.2026-07-02 17:38:00
TimeDATETIMETOTIME(datetime)Date TimeExtracts the time.DATETIMETOTIME(NOW())
Text&Two text valuesConcatenates text.'A' & 'B' returns AB
Text''One quoted valueDeclares Single-Line Text.'text'
Text''''''One triple-quoted valueDeclares Multi-Line Text.'''multiple lines'''
TextNUMBERSTRING(number)Number or amountConverts a number to uppercase Chinese numerals.NUMBERSTRING(198204.13)
TextNUMBERSTRINGRMB(number)Number or amountConverts a number to uppercase RMB text.NUMBERSTRINGRMB(198204.13)
Boolean<, >, >=, <=, !=Two comparable valuesCompares values.1 < 2 returns true
BooleanAND(boolean1, ...)Boolean valuesReturns true when all values are true.AND(2 > 1, 5 > 3)
BooleanOR(boolean1, ...)Boolean valuesReturns true when any value is true.OR(2 > 1, 5 < 3)
BooleanNOT(boolean)BooleanNegates the value.NOT(2 > 1)
BooleanISNULL(expression)Any valueTests whether a value is null.ISNULL(Mobile)
BooleanISNUMBER(string)TextTests whether text can become a number.ISNUMBER('5')
BooleanSTARTWITH(string1, string2)Two text valuesTests the start of text.STARTWITH('abcdef', 'ab')
BooleanENDWITH(string1, string2)Two text valuesTests the end of text.ENDWITH('aecdab', 'ab')
BooleanEQUALS(string1, string2)Two text valuesPerforms a case-sensitive comparison.EQUALS('Abc', 'abc')
BooleanCONTAINS(string1, string2)Two text valuesTests whether text contains a value.CONTAINS('abcdef', 'cd')

Common Validation Rules ​

1. End Date cannot precede Start Date ​

text
结束日期 < 开始日期

2. Completion Date is required when status is complete ​

text
AND(EQUALS(状态, '已完成'), ISNULL(完成日期))

3. Discount must not exceed 30%, and amount must exceed zero ​

text
OR(折扣率 > 0.3, 金额 <= 0)

4. Mobile or telephone is required ​

text
AND(ISNULL(手机), ISNULL(电话))