Problems with complex if statements in Notion formula

I’m trying to build a Notion database to monitor my relationships and reminders for when to contact friends. I’ve created a formula that uses several conditions to deliver different notifications based on the type of relationship and the time since I last reached out.

However, I am encountering issues with two particular types in my formula. It always displays “Time to check in!” for these relationship types, regardless of the date entered in the “Last Contacted” field.

Here’s the formula I’m using:

if((prop("Association") == "Friend" or prop("Association") == "Professional" or prop("Association") == "Mentor") and dateBetween(now(), prop("Last Contacted"), "months") > 5, "Time to check in!", if(prop("Association") == "Family" or prop("Association") == "Life-long Friend" and dateBetween(now(), prop("Last Contacted"), "months") > 0, "Time to check in!", if(prop("Association") == "Best Friends" or prop("Association") == "Immediate Family" and dateBetween(now(), prop("Last Contacted"), "weeks") > 1, "Time to check in!", "👍")))

The issue lies with the “Best Friends” and “Immediate Family” conditions. Even after changing the time frame to “months” like in my other conditions, it’s still not functioning correctly. Can anyone offer guidance on what I might be overlooking?

You nailed the precedence issue, but there’s another problem. Your dateBetween logic is backwards. When you write dateBetween(now(), prop("Last Contacted"), "weeks"), you get negative numbers for recent contacts. So “Best Friends” and “Immediate Family” with 1-week thresholds show values like -0.5 weeks, which Notion weirdly treats as greater than 1. Hit this same bug building a similar system last year. Swap your dateBetween parameters to dateBetween(prop("Last Contacted"), now(), "weeks") and you’ll get positive values for time elapsed. Then your greater-than comparisons actually work. Fix this plus the parentheses grouping and you’re golden.

Yeah, the parentheses thing is right, but you’ve got another issue. Your dateBetween function with “weeks” gets weird when Last Contacted is empty or has bad dates. I hit this same problem building my contact tracker. Empty date fields make Notion act unpredictably in date calculations, so the formula defaults to showing notifications. Check if Last Contacted actually has a valid date first. Try wrapping it like if(prop("Last Contacted") == empty(), "No contact date", your_existing_formula). This stops dateBetween from calculating against null values, which causes weird behavior. Also test your formula with recent dates in those problem fields to see if the time calculations work when you have valid dates.

operator precedence is definitely the issue, but your logic flow has problems too. your nested ifs stop evaluating after the first match. so if someone is both “Family” and “immediate Family”, they’ll hit the second if first and never reach the third condition. put your most specific relationship types first, then the broader ones. otherwise your “best friends” condition might never trigger even if you fix the parentheses.

Yeah, Samuel nailed the operator precedence problem. But honestly, complex formulas like this get messy in Notion. You’re already hitting walls with nested conditions and precedence issues.

I’ve been there with similar relationship tracking systems. Simple formulas turn into nightmares when you add more relationship types or change timing rules.

The real solution? Automation. Skip Notion’s formula limitations and set up workflows that check your database daily and send actual notifications when it’s time to reach out. No more nested conditions or precedence headaches.

You can trigger different actions by relationship type, send emails or Slack messages, even create calendar events for follow-ups. Way more powerful than static formulas showing text in a field.

I switched to this for my networking system and it’s been game changing. Automation handles the logic cleanly and I get proactive reminders instead of checking a database.

Yeah, the operator precedence thing is real, but this is exactly why I gave up on complex Notion formulas ages ago.

I tried building something similar for client outreach tracking and hit the same wall. Those nested conditions become a nightmare - every time you want to tweak a relationship category or change timeframes, you’re stuck debugging again.

What actually fixed this? I moved all the logic outside Notion. Now I run daily workflows that check my database, evaluate each contact against my criteria, and just update a simple status field. No more precedence headaches or dateBetween bugs.

You can handle the complex stuff cleanly in separate workflow steps. Check relationship type, calculate days since contact, apply different rules per category, then write back one clean result to Notion. So much better than shoving everything into one massive formula.

Best part? You can trigger real actions when contacts need attention. Emails, calendar reminders, updates to other systems - all automatic.

Been doing this for client relationship management for two years now. Never going back to complex Notion formulas.

Your formula has an operator precedence issue. When you write prop("Association") == "Family" or prop("Association") == "Life-long Friend" and dateBetween(now(), prop("Last Contacted"), "months") > 0, Notion processes the AND before the OR. So it’s checking: Family OR (Life-long Friend AND date condition). Same problem with your “Best Friends” and “Immediate Family” condition. You need parentheses around your OR conditions: (prop("Association") == "Best Friends" or prop("Association") == "Immediate Family") and dateBetween(now(), prop("Last Contacted"), "weeks") > 1. Without grouping them properly, the formula ignores the date condition and fires notifications regardless.

Had this exact issue with my client follow-up system. Beyond the operator precedence thing others mentioned, there’s a sneaky problem with your dateBetween calculations causing false positives. The dateBetween function returns negative values when Last Contacted is in the future or there’s timezone weirdness. You’re only checking if the result is greater than your threshold, but you’re not handling negative values or zero. Add a check to make sure the date difference is actually positive before comparing. Use dateBetween(now(), prop("Last Contacted"), "weeks") >= 1 instead of just greater than. This completely fixed my phantom notifications. Also double-check that your Last Contacted field is properly formatted as a date property.