Skip to content

How to Fix Notion Formula Property Returning Wrong Result

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about How to Fix Notion Formula Property Returning Wrong Result. We cover key concepts, practical examples, and best practices.

Notion formula properties compute values based on other properties in the same database. When a formula returns an error, an unexpected number, or "NaN," the syntax is incorrect, the function name is wrong, or the referenced properties contain data types the formula cannot handle.

The Problem

You write a formula like prop("Price") * prop("Quantity") and it returns an empty cell, "NaN," or "Type mismatch." Other formulas in the same database work fine.

Wrong approach — rewriting the formula from scratch without checking the data types.

The Fix

Check the data types of referenced properties:

Price = Number (not Text or Select)
Quantity = Number (not Text)

If the property type is wrong, create a helper formula to convert:

toNumber(prop("Price String"))  ← converts text to number

For empty or missing values, add a check:

if(empty(prop("Price")), 0, prop("Price")) * if(empty(prop("Quantity")), 0, prop("Quantity"))

For date formulas, use the correct date functions:

dateBetween(prop("Due Date"), prop("Start Date"), "days")
formatDate(prop("Date"), "MMMM D, YYYY")

Expected output:

Formula calculates the correct value
Number formulas show numeric results
Date formulas show formatted dates or day differences

Prevention Tips

  • Verify referenced property types match the formula expectations
  • Use empty() checks to handle missing values gracefully
  • Test complex formulas by splitting them into separate formula properties
  • Use format() to convert numbers to text when concatenating
  • Reference Notion's formula documentation for function names — they differ from Excel

Common Mistakes with formula property

  1. Mixing let bindings with <- bindings in do notation, producing type errors
  2. Overlapping type class instances that cause GHC to reject the program with ambiguous dispatch errors
  3. Non-exhaustive pattern matches that compile with warnings then crash at runtime

These mistakes appear frequently in real-world NOTION code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### How do I concatenate text and numbers in a Notion formula?

Use the + operator: prop("Name") + " - " + format(prop("Price")). The format() function converts the number to text. Without format(), you get a "Type mismatch" error because text and numbers cannot be added.

Why does my formula return "NaN"?

"NaN" means "Not a Number" — the formula is trying to do a mathematical operation on non-numeric data. Check all referenced properties for their types. Text, Select, and Date properties used in arithmetic produce NaN.

Can I use if-then-else logic in Notion formulas?

Yes, the syntax is: if(condition, value_if_true, value_if_false). Conditions use comparison operators: ==, !=, >, <, >=, <=. Combine conditions with and() and or(). Nested ifs are supported: if(A, "Yes", if(B, "Maybe", "No")).

Related: DodaTech's Formula Debugger parses Notion formula syntax, checks for type mismatches, and provides a test environment for complex calculations before deploying them to production databases. Use with DodaZIP.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro