What formulas can do
- Calculate values — add prices, compute totals, perform math operations.
- Manipulate text — combine strings, change case, extract substrings.
- Work with dates — calculate time differences, format dates, determine deadlines.
- Apply logic — use conditional statements to display different values.
- Process lists — filter, sort, map, or aggregate list data.
Create a formula property
Name and define the formula
Enter a name for the formula property and type your formula expression in the Formula field.
Write a formula
A formula is an expression that combines properties, operators, and functions.Reference properties
You can reference three types of properties:| Type | Syntax | Example |
|---|---|---|
| Note property (frontmatter) | property_name or note.property_name | price, note.price |
| File property | file.name, file.size, file.mtime | file.mtime |
| Another formula | formula.formula_name | formula.price_per_unit |
Operators
Arithmetic:true or false):
Functions
Functions perform operations on values. The available functions depend on the value type. See the full function list in Bases syntax.| Category | Examples |
|---|---|
| Global | if(), now(), today(), date(), link(), max(), min() |
| String | contains(), replace(), split(), lower(), title() |
| Number | round(), ceil(), floor(), abs(), toFixed() |
| Date | format(), relative(), date(), time() |
| List | filter(), map(), sort(), join(), unique() |
Formula examples
Calculate a deadline
Calculate a deadline
Set a project’s due date to 2 weeks after the start date:
Display overdue status
Display overdue status
Show “Overdue” if the due date has passed and the task isn’t done:
Format currency
Format currency
Display a price with two decimal places and a currency symbol:
Count list items
Count list items
Count the number of items in a list property:
Calculate a priority score
Calculate a priority score
Combine multiple factors into a single score:
Combine text fields
Combine text fields
Create a full name from first and last name properties:
Calculate total cost
Calculate total cost
Multiply a monthly cost by the number of months, using another formula:
Data types
Formulas work with these data types:| Type | Description | Examples |
|---|---|---|
| String | Text in quotes | "hello", 'world' |
| Number | Numeric values | 42, 3.14 |
| Boolean | True or false | true, false |
| Date | Date or datetime | Created with date(), today(), or now() |
| List | Ordered collection | [1, 2, 3] |
| Object | Key-value pairs | {"name": "value"} |