↙️

Write Nested IF Statements

Master Tag
Tips & Tricks
Created
Mar 2, 2020 07:26 PM
Usage
If Nested
dateBetween
Greater Than
Web Tags
Formula
Database
Function
Alternatives
Cover
↙️
In this tutorial I'm going to explain how nested IF statements are written inside Notion formulas. You may need a preliminary understanding of Notion formulas before understanding alternate syntaxes but I'll try my best to explain everything from the ground up. Elements I'll be using: Number, Multi-Select, Title, Date and Formula properties.

The result we want in plain english →

  • if tag equals Work :: Checked
  • if due within 2 weeks :: Checked
  • if hours allotted greater than 2 hours :: Checked
  • Otherwise :: Unchecked

The result in a nested IF Statement →

if(if(if(prop("Tags") == "Work", true, false), dateBetween(prop("Due"), prop("Today"), "days") <= 14, true), prop("Hours Allotted") > 2, true)

Break Down →

Essentially, we're going to work from the middle out:
  • if tag equals Work :: Checked → if(prop("Tags") == "Work", true, false)
  • if due within 2 weeks :: Checked → if(if(prop("Tags") == "Work", true, false), dateBetween(prop("Due"), prop("Today"), "days") <= 14, true)
  • if hours allotted greater than 2 hours :: Checked → if(if(if(prop("Tags") == "Work", true, false), dateBetween(prop("Due"), prop("Today"), "days") <= 14, true), prop("Hours Allotted") > 2, true)
Nested IF Statements
Name
Tags
Today
Due
Hours Allotted
Column
Home
Mar 11, 2020
2
Work
Mar 19, 2020
1
Personal
Mar 26, 2020
1
Work
Mar 6, 2020
6

Syntax Reference →

  1. FALSE: if(true, false, true)
  1. FALSE: if(if(true, false, true), true, false)
  1. TRUE: if(if(if(true, false, true), true, false), false, true)
  1. TRUE: if(if(if(if(true, false, true), true, false), false, true), true, false)