Formula syntax & functions
Notion formulas can operate on various properties and functions. Here, you'll find a list of them ➗
Looking for Notion formula basics? Check out this article →
Notion formulas can operate using various properties and functions. Here, you'll find a list of them!
Formulas support almost all property types. Note that formula types are different from property types.
Property Types | Examples | Formula Type |
---|---|---|
Title |
| Text |
Text |
| Text |
Select |
| Text |
Multi-Select |
| Text (list) |
Checkbox |
| Boolean |
Email, URL, Phone Number |
| Text |
Unique ID |
| Text |
Created By, |
| Person |
Person |
| Person (list) |
Date, |
| Date |
Number |
| Number |
Relation |
| Page (list) |
Rollup |
| Number, date, or list of any type. Depends on rollup configuration. |
Built-ins are specific symbols and values that are built into the language to help designate a calculation.
Built-in | Example |
---|---|
Math operators: |
|
Boolean values: |
|
Comparison operators: |
|
Logical operators: |
|
Ternary operator: |
|
Notion formulas support the following functions.
Name | Description | Example |
---|---|---|
if | Returns the first value if the condition is true; otherwise, returns the second value. |
|
ifs | Returns the value that corresponds to the first true condition. This can be used as an alternative to multiple nested if() statements. |
|
empty | Returns true if the value is empty. 0, “”, and [] are considered empty. |
|
length | Returns the length of the text or list value. |
|
substring | Returns the substring of the text from the start index (inclusive) to the end index (optional and exclusive). |
|
contains | Returns true if the search string is present in the value. |
|
test | Returns true if the value matches the regular expression and false otherwise. |
|
match | Returns all matches of the regular expression as a list. |
|
replace | Replaces the first match of the regular expression with the replacement value. |
|
replaceAll | Replaces all matches of the regular expression with the replacement value. |
|
lower | Converts the text to lowercase. |
|
upper | Converts the text to uppercase. |
|
repeat | Repeats the text a given number of times. |
|
link | Creates a hyperlink from the label text and the URL. |
|
style | Adds styles and colors to the text. Valid formatting styles: |
|
unstyle | Removes formatting styles from the text. If no styles are specified, all styles are removed. |
|
format | Returns the value formatted as text. |
|
add | Returns the sum of two numbers. |
|
subtract | Returns the difference of two numbers. |
|
multiply | Returns the product of two numbers. |
|
mod | Returns the first number modulo the second number. |
|
pow | Returns the result of a base number raised to an exponent power. |
|
divide | Returns the quotient of two numbers. |
|
min | Returns the smallest number of the arguments. |
|
max | Returns the largest number of the arguments. |
|
sum | Returns the sum of its arguments. |
|
median | Returns the middle value of its arguments. |
|
mean | Returns the arithmetic average of its arguments. |
|
abs | Returns the absolute value of the number. |
|
round | Returns the value of a number rounded to the nearest integer. |
|
ceil | Returns the smallest integer greater than or equal to the number. |
|
floor | Returns the largest integer less than or equal to the number. |
|
sqrt | Returns the positive square root of the number. |
|
cbrt | Returns the cube root of the number. |
|
exp | Returns e^x, where x is the argument, and e is Euler's number (2.718…), the base of the natural logarithm. |
|
ln | Returns the natural logarithm of the number. |
|
log10 | Returns the base 10 logarithm of the number. |
|
log2 | Returns the base 2 logarithm of the number. |
|
sign | Returns 1 if the number is positive, -1 if it is negative, and 0 if it is zero. |
|
pi | Returns the ratio of a circle's circumference to its diameter. |
|
e | Returns the base of the natural logarithm. |
|
toNumber | Parses a number from text. |
|
now | Returns the current date and time. |
|
today | Returns the current date without the time. |
|
minute | Returns the minute of the date (0-59). |
|
hour | Returns the hour of the date (0-23). |
|
day | Returns the day of the week of the date, between 1 (Monday) and 7 (Sunday). |
|
date | Returns the day of the month from the date (1-31). |
|
week | Returns the ISO week of the year of the date (1-53). |
|
month | Returns the month of the date (1-12). |
|
year | Returns the year of the date. |
|
dateAdd | Adds time to the date. The unit argument can be one of: |
|
dateSubtract | Subtracts time from the date. The unit argument can be one of: |
|
dateBetween | Returns the difference between two dates. The unit argument can be one of: |
|
dateRange | Returns a date range constructed from the start and end dates. |
|
dateStart | Returns the start of the date range. |
|
dateEnd | Returns the end of the date range. |
|
timestamp | Returns the current Unix timestamp, representing the number of milliseconds that have elapsed since January 1, 1970. |
|
fromTimestamp | Returns the date from the given Unix timestamp. The timestamp represents the number of milliseconds that have elapsed since January 1, 1970. Note: the returned date will not retain the seconds & milliseconds. |
|
formatDate | Formats the date using a custom format string. The format string can contain the following text to represent parts of the date: |
|
parseDate | Returns the date parsed according to the ISO 8601 standard. |
|
name | Returns the name of a person. |
|
Returns the email address of a person. |
| |
at | Returns the value at the specified index in a list. |
|
first | Returns the first item in the list. |
|
last | Returns the last item in the list. |
|
slice | Returns the items of the list from the provided start index (inclusive) to the end index (optional and exclusive). |
|
concat | Returns the concatenation of multiple lists. |
|
sort | Returns the list in sorted order. |
|
reverse | Returns the reversed list. |
|
join | Returns the values of the list with the joiner placed between each of the values. |
|
split | Returns the list of values created by splitting a text input by a separator. |
|
unique | Returns the list of unique values in the input list. |
|
includes | Returns true if the list contains the specified value, and false otherwise. |
|
find | Returns the first item in the list for which the condition evaluates to true. |
|
findIndex | Returns the index of the first item in the list for which the condition is true. |
|
filter | Returns the values in the list for which the condition is true. |
|
some | Returns true if any item in the list satisfies the given condition, and false otherwise. |
|
every | Returns true if every item in the list satisfies the given condition, and false otherwise. |
|
map | Returns the list populated with the results of calling the expression on every item in the input list. |
|
flat | Flattens a list of lists into a single list. |
|
id | Returns the id of the page. If no page is provided, returns the id of the page the formula is on. |
|
equal | Returns true if both values are equal and false otherwise. |
|
unequal | Returns false if both values are equal and true otherwise. |
|
let | Assigns a value to a variable and evaluates the expression using that variable. |
|
lets | Assigns values to multiple variables and evaluates the expression using those variables. |
|