N Notion

How to write basic database formulas on Notion

beginner 8 min read Updated 2026-03-18
Quick Answer

Writing database formulas in Notion involves adding a Formula property to your database and using Notion's formula syntax to perform calculations. You can combine text, numbers, and other properties using functions like add, multiply, concat, and if statements.

Prerequisites

  • Basic familiarity with Notion interface
  • Understanding of database properties
  • Knowledge of basic mathematical operations
  • Created at least one database in Notion

Step-by-Step Instructions

1

Add a Formula Property to Your Database

Open your Notion database and click the + button at the top right of your table view to add a new property. Select Formula from the property type dropdown menu. Give your formula property a descriptive name like "Total Price" or "Days Remaining".
Choose a clear name for your formula property to make it easier to understand what calculation it performs.
2

Open the Formula Editor

After creating the formula property, click on it to open the formula editor. You'll see a text box where you can write your formula, along with a list of available functions and properties on the right side. The editor also shows a preview of how your formula will work with sample data.
3

Write a Basic Mathematical Formula

Start with simple arithmetic operations. For example, to multiply a quantity by a price, type: prop("Quantity") * prop("Price"). Use prop("Property Name") to reference other columns in your database. You can use operators like +, -, *, / for basic math.
Property names in formulas are case-sensitive and must match exactly with your column names.
4

Use Text Functions for String Operations

To combine text from different properties, use the concat() function: concat(prop("First Name"), " ", prop("Last Name")). For text manipulation, try functions like upper() to convert to uppercase, lower() for lowercase, or length() to count characters.
Remember to include spaces and punctuation as separate strings when concatenating text.
5

Create Conditional Logic with IF Statements

Use if() functions to create conditional formulas: if(prop("Status") == "Complete", "✅ Done", "⏳ In Progress"). The syntax is if(condition, value_if_true, value_if_false). You can nest multiple if statements for complex logic.
Use double equals (==) for comparison, not single equals which is used for assignment in other programming languages.
6

Work with Dates and Times

For date calculations, use functions like dateBetween() to find differences: dateBetween(prop("Due Date"), now(), "days"). Use now() for current date/time, dateAdd() to add time periods, and formatDate() to customize date display.
The third parameter in dateBetween() can be "years", "months", "weeks", "days", "hours", or "minutes".
7

Test and Refine Your Formula

Click Done to apply your formula and see the results in your database. Check several rows to ensure the formula works correctly with different data types. If you need to edit, click on the formula property header and select Edit property to return to the formula editor.
Always test your formula with edge cases like empty cells or unexpected data to ensure it handles all scenarios properly.

Common Issues & Troubleshooting

Formula shows 'Type mismatch' error

Check that you're using the correct data types. Make sure number properties contain actual numbers, not text. Use toNumber() function to convert text to numbers if needed.

Property reference not working

Verify that the property name in your prop() function exactly matches the column name, including capitalization and spaces. Property names are case-sensitive in formulas.

Formula returns empty or null values

Use the empty() function to check for null values and provide defaults: if(empty(prop("Price")), 0, prop("Price")). This prevents calculations from breaking when cells are empty.

Complex formula is difficult to read

Break complex formulas into multiple formula properties, or use line breaks and proper spacing in the formula editor to make your code more readable. Consider using intermediate calculations in separate columns.

Prices mentioned in this guide are pulled from current plan data and may change. Always verify on the official Notion website before purchasing.