Formula Syntax & Functions - Notion Help Center
Formula Syntax & Functions - Notion Help Center
Learn more →
Search
IN THIS ARTICLE
Properties
Built-ins
Functions
Notion formulas can operate using various properties and functions. Here, you'll find a list of
them!
Properties
Formulas support almost all property types. Note that formula types are different from
property types.
prop("Title")
Title Text
prop("Title").length()
prop("Text")
Text Text
prop("Text").length()
prop("Tags").length()
Multi-Select prop("Tags").includes("Financ Text (list)
e")
prop("Checkbox")
Checkbox Boolean
not prop("Checkbox")
!empty(prop("Phone"))
Email, URL, !empty(prop("Email"))
Text
Phone Number link("Call", "tel:" +
prop("Phone"))
prop("Task ID").split("-
").first() ← Prefix
Unique ID Text
prop("Task ID").split("-
").last() ← ID
prop("Person")
prop("Person").at(0).name()
Person Person (list)
prop("Person").map(current.e
mail())
Date,
prop("Due Date") > now()
Created Time,
dateBetween(prop("Birthday" Date
Last Edited
), now(), "days")
Time
prop("Number") / 2
Number Number
pi() * prop("Radius") ^ 2
prop("Tasks").length()
Relation prop("Tasks").filter(current.pr Page (list)
op("Status"W !XX "Done")
Built-ins
Built-ins are specific symbols and values that are built into the language to help designate a
calculation.
Built-in Example
and:
true and false
true && false
and(true, false)
or:
Logical operators:
true or false
and , or , not
true || false
or(true, false)
not:
not true
!true
Ternary operator:
X ? Y b Z is equivalent to if(X, Y, ZW
?b
Functions
Notion formulas support the following functions.
if(true, 1, 2W =
1
if(false, 1, 2W =
Returns the first value if the condition is true; 2
if
otherwise, returns the second value. prop("Checked")
== true ?
"Complete" :
"Incomplete"
ifs(true, 1, true,
Returns the value that corresponds to the first
2, 3W = 1
ifs true condition. This can be used as an alternative
ifs(false, 1, false,
to multiple nested if() statements.
2, 3W = 3
empty(0) =
Returns true if the value is empty. 0, “”, and [] are true
empty
considered empty. empty([]) =
true
length("hello") =
5
length Returns the length of the text or list value.
length([1, 2, 3iW
= 3
substring("Notio
Returns the substring of the text from the start n", 0, 3W =
substring index (inclusive) to the end index (optional and "Not"
exclusive). substring("Notio
n", 3W = "ion"
test("Notion",
Returns true if the value matches the regular "Not") = true
test
expression and false otherwise. test("Notion",
"\\d") = false
match("Notion
Notion", "Not") =
["Not", "Not"]
Returns all matches of the regular expression as
match match("Notion
a list.
123 Notion 456",
"\\d+") =
["123", "456"]
replace("Notion
Replaces the first match of the regular expression Notion", "N", "M")
replace
with the replacement value. = "Motion
Notion"
replaceAll("Notio
n Notion", "N",
"M") = "Motion
Replaces all matches of the regular expression
replaceAll Motion"
with the replacement value.
replaceAll("Notio
n 123", "\\d", "")
= "Notion"
lower("NOTION")
lower Converts the text to lowercase.
= "notion"
upper("notion")
upper Converts the text to uppercase.
= "NOTION"
repeat("0", 4W =
"0000"
repeat("~=", 10W
repeat Repeats the text a given number of times.
=
"~=~=~=~=~=~=
~=~=~=~="
link("Notion",
Creates a hyperlink from the label text and the
link "https://notion.so
URL.
") = "Notion"
unstyle("Text")
Removes formatting styles from the text. If no
unstyle unstyle("Text",
styles are specified, all styles are removed.
"b")
format(1234) =
"1234"
format Returns the value formatted as text. format(now()) =
"August 30,
2023 17b55"
add(5, 10W =
add Returns the sum of two numbers. 15
5 p 10 = 15
subtract(5, 10W =
subtract Returns the difference of two numbers. q5
5 q 10 = q5
multiply(5, 10W =
multiply Returns the product of two numbers. 50
5 r 10 = 50
pow(5, 10W =
Returns the result of a base number raised to an 9765625
pow
exponent power. 5 ^ 10 =
9765625
divide(5, 10W =
divide Returns the quotient of two numbers. 0.5
5 / 10 = 0.5
min(1, 2, 3W = 1
min Returns the smallest number of the arguments. min([1, 2, 3iW =
1
max(1, 2, 3W =
3
max Returns the largest number of the arguments.
max([1, 2, 3iW =
3
sum(1, 2, 3W =
6
sum Returns the sum of its arguments.
sum([1, 2, 3i, 4,
5W = 15
median(1, 2, 4W X
2
median Returns the middle value of its arguments.
median([1, 2, 3i,
4W X 2.5
mean(1, 2, 3W X 2
mean Returns the arithmetic average of its arguments. mean([1, 2, 3i, 4,
5W X 3
abs(10) = 10
abs Returns the absolute value of the number.
abs(-10) = 10
round(0.4) = 0
round(-0.6) =
Returns the value of a number rounded to the q1
nearest integer. Supports one or two arguments. round(1.234, 0W
round In the two-argument case, the first represents = 1
the value and the second represents the number round(1.234, 2W
of decimal places to round to. = 1.23
round(1234, q2W
= 1200
sqrt(4) = 2
sqrt(7) =
sqrt Returns the positive square root of the number.
2.645751311064
5907
cbrt(9) =
2.080083823051
cbrt Returns the cube root of the number.
904
cbrt(64) = 4
exp(1) =
2.718281828459
Returns e^x, where x is the argument, and e is
045
exp Euler's number \2.718…), the base of the natural
exp(-1) =
logarithm.
0.3678794411714
4233
ln(2.7182818284
59045W = 1
ln Returns the natural logarithm of the number. ln(10) =
2.302585092994
046
log10v10W = 1
log10 Returns the base 10 logarithm of the number. log10v100000W =
5
log2v4W = 2
log2 Returns the base 2 logarithm of the number. log2v1024W =
10
pi() =
Returns the ratio of a circle's circumference to its
pi 3.141592653589
diameter.
793
e() =
e Returns the base of the natural logarithm. 2.718281828459
045
toNumber("2") =
2
toNumber(now()
) =
toNumber Parses a number from text.
169344330000
0
toNumber(true)
= 1
now() =
now Returns the current date and time. wAugust 30,
2023 5b55 PM
today() = wApril
today Returns the current date without the time.
19, 2024
minute(parseDat
e("2023q07q
minute Returns the minute of the date \0b59f.
10T17b35Z")) =
35
hour(parseDate(
"2023q07q
hour Returns the hour of the date \0b23f.
10T17b35Z")) =
17
day(parseDate("
Returns the day of the week of the date, between 2023q07q
day
1 \Monday) and 7 \Sunday). 10T17b35Z")) =
1
date(parseDate(
Returns the day of the month from the date \1b "2023q07q
date
31f. 10T17b35Z")) =
10
week(parseDate
Returns the ISO week of the year of the date \1b
week ("2023q01q02"))
53f.
= 1
month(parseDat
e("2023q07q
month Returns the month of the date \1b12f.
10T17b35Z")) =
7
year(now()) =
year Returns the year of the date.
2023
dateAdd(now(),
1, "days") =
wAugust 31,
2023 5b55 PM
dateAdd(now(),
Adds time to the date. The unit argument can be 2, "months") =
dateAdd one of: "years" , "quarters" , "months" , "weeks" , wOctober 30,
"days" , "hours" , or "minutes" . 2023 5b55
PM
dateAdd(now(),
3, "years") =
wAugust 30,
2026 5b55 PM
dateSubtract(no
w(), 1, "days") =
wAugust 29,
2023 5b55 PM
dateSubtract(no
Subtracts time from the date. The unit argument
w(), 2, "months")
dateSubtract can be one of: "years" , "quarters" , "months" ,
= wJune 30,
"weeks" , "days" , "hours" , or "minutes" .
2023 5b55 PM
dateSubtract(no
w(), 3, "years")
= wAugust 30,
2020 5b55 PM
dateBetween(no
w(),
parseDate("202
Returns the difference between two dates. The
2q09q07"),
unit argument can be one of: "years" , "quarters" ,
dateBetween "days") = 357
"months" , "weeks" , "days" , "hours" , or
dateBetween(pa
"minutes" .
rseDate("2030q
01q01"), now(),
"years") = 6
dateRange(prop(
"Start Date"),
prop("End
Returns a date range constructed from the start Date")) =
dateRange
and end dates. wSeptember 7,
2022 →
September 7,
2023
dateStart(prop("
Date Range")) =
wSeptember 7,
2022
dateBetween(da
dateStart Returns the start of the date range.
teStart(prop("Da
te Range")),
dateEnd(prop("D
ate Range")),
"days") = q365
dateEnd(prop("D
ate range")) =
wSeptember 7,
2023
dateBetween(da
dateEnd Returns the end of the date range.
teEnd(prop("Dat
e Range")),
dateStart(prop("
Date Range")),
"days") = 365
timestamp(now()
Returns the current Unix timestamp, representing
) =
timestamp the number of milliseconds that have elapsed
169344330000
since January 1, 1970.
0
formatDate(now
(), "MMMM D,
Y") = "August
Formats the date using a custom format string. 30, 2023"
The format string can contain the following text formatDate(now
formatDate to represent parts of the date: "YYYY" for year, (),
"MM" for month, "DD" for day, "h" for hour, "MM/DD/YYYY")
"mm" for minute. = "08/30/2023"
formatDate(now
(), "h:mm A") =
"17b55 PM"
parseDate("202
2q01q01") =
wJanuary 1,
2022
Returns the date parsed according to the ISO
parseDate parseDate("202
8601 standard.
2q01q
01T00b00Z") =
wDecember 31,
2021 4b00 PM
name(prop("Cre
ated By"))
prop("Pioneers")
name Returns the name of a person. .map(name(curr
ent)).join(", ") =
"Grace Hopper,
Ada Lovelace"
email(prop("Cre
ated By"))
email Returns the email address of a person. prop("People").
map(email(curre
nt)).join(", ")
at([1, 2, 3i, 1W =
at Returns the value at the specified index in a list.
2
first([1, 2, 3iW =
first Returns the first item in the list.
1
last([1, 2, 3iW =
last Returns the last item in the list.
3
slice([1, 2, 3i, 1,
Returns the items of the list from the provided 2W = {2i
slice start index (inclusive) to the end index (optional slice(["a", "b",
and exclusive). "c"], 1W = ["b",
"c"]
sort([3, 1, 2iW =
sort Returns the list in sorted order.
{1, 2, 3i
reverse(["green",
"eggs", "ham"])
reverse Returns the reversed list.
= ["ham", "eggs",
"green"]
join(["a", "b",
"c"], ", ") = "a,
Returns the values of the list with the joiner b, c"
join
placed between each of the values. join(["dog",
"go"], "") =
"doggo"
split("apple,pear,
Returns the list of values created by splitting a orange", ",") =
split
text input by a separator. ["apple", "pear",
"orange"]
unique([1, 1, 2iW
unique Returns the list of unique values in the input list.
= {1, 2i
includes(["a",
"b", "c"], "b") =
Returns true if the list contains the specified
includes true
value, and false otherwise.
includes([1, 2,
3i, 4W = false
find(["a", "b",
"c"], current ==
Returns the first item in the list for which the "b") = "b"
find
condition evaluates to true. find([1, 2, 3i,
current | 100W =
Empty
findIndex(["a",
"b", "c"], current
Returns the index of the first item in the list for == "b") = 1
findIndex
which the condition is true. findIndex([1, 2,
3i, current >
100W = q1
filter([1, 2, 3i,
current | 1W =
Returns the values in the list for which the {2, 3i
filter
condition is true. filter(["a", "b",
"c"], current ==
"a") = ["a"]
some([1, 2, 3i,
current XX 2W =
true
Returns true if any item in the list satisfies the
some some(["a", "b",
given condition, and false otherwise.
"c"],
current.length >
2W = false
every([1, 2, 3i,
current | 0W =
Returns true if every item in the list satisfies the true
every
given condition, and false otherwise. every(["a", "b",
"c"], current ==
"b") = false
map([1, 2, 3i,
current p 1W =
Returns the list populated with the results of
{2, 3, 4i
map calling the expression on every item in the input
map([1, 2, 3i,
list.
current + index)
= {1, 3, 5i
flat([1, 2, 3iW =
{1, 2, 3i
flat Flattens a list of lists into a single list. flat([[1, 2i, {3,
4iiW = {1, 2, 3,
4i
id()
Returns the id of the page. If no page is provided,
id id(prop("Relation"
returns the id of the page the formula is on.
).first())
equal(1, 1) =
Returns true if both values are equal and false true
equal
otherwise. "a" == "b" =
false
unequal(1, 2) =
Returns false if both values are equal and true true
unequal
otherwise. "a" !X "a" =
false
let(person,
"Alan", "Hello, " +
person + "!") =
Assigns a value to a variable and evaluates the "Hello, Alan!"
let
expression using that variable. let(radius, 4,
round(pi() *
radius ^ 2WW =
50
lets(a, "Hello", b,
"world", a + " " +
b) = "Hello
Assigns values to multiple variables and world"
lets
evaluates the expression using those variables. lets(base, 3,
height, 8, base *
height / 2W =
12
GIVE FEEDBACK
Up next
Common formula errors
Learn about the common errors you might run into with formulas in Notion, and how you can
troubleshoot them
Read more →
English vUSW
Company Download
About us iOS & Android
Careers Mac & Windows
Security Calendar
Status Web Clipper
Terms & privacy
Your privacy rights