and

Learn how to use the Boolean "and" operator in Notion formulas.

The and operator returns true if and only if both of its operands have a true Boolean value. Otherwise, it will return false. It accepts Boolean operands.

Boolean and Boolean and(Boolean, Boolean) Boolean && Boolean

And is useful for testing that two or more things are true.

Good to know: Notion is no longer picky, so &&AND, and And now also work. 

You can also use the function version, and().

true and true /* Output: true */ true && false /* Output: false */ and(1 > 0, 0 < 4) /* Output: true */ if(true and true, "Happy", "Sad") /* Output: "Happy" */ if(true and false, "Happy", "Sad") /* Output: "Sad" */ if(5 > 4 and 1 < 3, true, false) /* Output: true */ if(length("Monkey D. Luffy") > 5 and length("Monkey D. Luffy") < 100, true, false) /* Output: true */

The and operator can also be chained together multiple times:

4 > 2 and 3 < 4 and 5 > 2 and 7 == 7 ? true : false /* Output: true */

The example database below shows a list of shore leave requests from a pirate crew. The captain will only approve a request if both are true:

  • The request doesn’t fall on one of that crew member’s watch duty days
  • The crew member has less than $10,000 in gambling debt

The Approved? formula uses the and operator to ensure that both of these conditions are true. If so, it’ll output true and the request will be approved. If not, it’ll output false and the request will be denied.

Notion – The all-in-one workspace for your notes, tasks, wikis, and databases.
A new tool that blends your everyday work apps into one. It’s the all-in-one workspace for you and your team
thomasfrank.notion.site
// Compressed if(prop("Gambling Debt") < 10000 and not contains(prop("Watch Duty Days"), formatDate(prop("Request Date"), "dddd")), true, false) // Expanded if( prop("Gambling Debt") < 10000 and not contains( prop("Watch Duty Days"), formatDate( prop("Request Date"), "dddd" ) ), true, false )

This formula uses an if statement to check that both of the captain’s conditions are true:

  • The first operand checks that the crew member’s gambling debt is < 10000
  • The second operand checks the request date against the crew member’s assigned watch days:
    • The contains function checks to see if the Request Date’s day of the week is contained in the Watch Duty Days list for each row.
    • The formatDate function uses the Moment.js string dddd to convert the Request Date into a named day of the week (i.e. “Wednesday”) so it can be compared against the tags in the Watch Duty Days property.
    • Finally, the not operator negates the boolean output of the contain() function, ensuring the and operator only returns true if the Request Date DOESN’T match an assigned Watch Duty Day.

Other formula components used in this example:

smaller – Thomas Frank
thomasjfrank.com
if – Thomas Frank
thomasjfrank.com
contains – Thomas Frank
thomasjfrank.com
Notion Formula Syntax – Thomas Frank
thomasjfrank.com
formatDate – Thomas Frank
thomasjfrank.com
About the Author

My name is Thomas Frank, and I'm a Notion-certified writer, YouTuber, and template creator. I've been using Notion since 2018 to organize my personal life and to run my business and YouTube channel. In addition to this formula reference, I've created a free Notion course for beginners and several productivity-focused Notion templates. If you'd like to connect, follow me on Twitter.

🤔 Have an UB Question?

Fill out the form below and I’ll answer as soon as I can! ~Thomas

🤔 Have a Question?

Fill out the form below and I’ll answer as soon as I can! ~Thomas