This reference provides technical details and examples for every Notion function, operator and constant, as well as the patterns used to format dates using the formatDate()
function.
If you’re new to formulas, consider wetting your toes with our introductory post, Meet Notion’s Formula Property.
As questions emerge in your work with formulas, send them our way on Twitter, or simply respond to the newsletter.
Navigate
Functions
Need a function refresher? Find them in
Meet Notion’s Formula Property.
Logic Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Numeric Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Text Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date & Time Functions
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
Operators
Need some context? Jump to Operators in
Meet Notion's Formula Property.
Arithmetic Operators
Operator | Description | Example |
---|---|---|
| Subtracts the right operand from the left operand to return their difference. | 4 - 2 → 2 |
| Multiplies its operands to return their product. | 3 * 6 → 18 |
| The modulus operator returns the remainder after dividing the left operand by the right operand. | 23 % 7 → 2 |
| Divides the left operand by the right operand to return their quotient. | 21 / 7 → 3 |
| Adds numeric operands to return their sum, or concatenates (combines) textual operands (strings). | 2 + 2 → 4 |
Comparison Operators
Operator | Description | Example |
---|---|---|
| Unequal | 2 != 2 → false |
| Less Than or Equal | 2 <= 3 → true |
| Equal | 2 == 2 → true |
| Greater Than | 2 > 2 → false |
| Less Than | 2 < 3 → true |
| Greater Than or Equal | 2 >= 2 → true |
Date Formats
Combine these patterns to construct the second argument of the formatDate()
function.
Category | Pattern | Rendering |
---|---|---|
Year | YY | 13 |
YYYY | 2013 | |
Quarter | Q | 1... 4 |
Qo | 1st... 4th | |
Month | M | 1... 12 |
Mo | 1st... 12th | |
MM | 01... 12 | |
MMM | Jan | |
MMMM | January | |
Week of year | w | 1... 53 |
wo | 1st... 53rd | |
ww | 01... 53 | |
Day of year | DDD | 1... 365 |
DDDo | 1st... 365th | |
DDDD | 001... 365 | |
Day | D | 1... 31 |
Do | 1st... 31st | |
DD | 01... 31 | |
Weekday | d | 0... 6 |
dd | Su | |
ddd | Sun | |
dddd | Sunday | |
24h hour | H | 0... 23 |
HH | 00... 23 | |
12h hour | h | 1... 12 |
hh | 01... 12 | |
Minutes | m | 0... 59 |
mm | 00... 59 | |
Seconds | s | 0... 59 |
ss | 00... 59 | |
AM/PM | a | am |
A | AM | |
Timezone offset | Z | =+07:00 |
ZZ | =+0730 | |
Deciseconds | S | 0... 9 |
SS | 00... 99 | |
Milliseconds | SSS | 000... 999 |
Unix timestamp | X | 1581483600 |
Millisecond Unix timestamp | x | 1581483600000 |
Constants
Constant | Description | ~Value |
---|---|---|
e | The base of the natural logarithm. | 2.718281828459 |
false | false | |
true | true | |
pi | The ratio of a circle's circumference to its diameter. | 3.14159265359 |