# Logic functions in Notion formulas!

*In the previous article, we learned about basic mathematical operators that are used in formulas inside Notion! This article will introduce you to Logic functions. Similar to the previous article, I will explain every function along with an example for each function. *💯

This article is a part of theFantastic Formulasseries. This series features helpful articles about formulas in Notion.

Logic functions are a set of functions that allow you to perform Boolean logic operations in Notion formulas. Boolean logic operations are operations that return a value of either true or false. These functions are useful for creating conditions and making decisions in your formulas. The main logic functions available in Notion formulas are 🔽

- if
- equal
- unequal
- smaller/smallerEq
- larger/largerEq
- and
- not
- empty
- or

Today we will only learn how to use the first 5 logic functions! Just like in the previous article, I will proceed with a simple database as an example to make it easily understandable and representable. This time, let's say we want to build a simple database for tracking inventory items in our Notion workspace. 👀

In this database shown below, you can see 3 properties. First property shows the name of items, second one shows the number of that item in the inventory and the third property shows the minimum amount of stock that should be maintained. ✅

*1. if()*

The IF function is used to test a condition and return one value if the condition is true and another value if the condition is false. The syntax of the IF function is

Let's say we want a property that shows us the status of the item based on the amount of units present in the inventory. For a simple column that only shows if the stock is in excess, we can use a single 'if' statement. ✅

As you can see below, the formula is perfectly working 🔽

Say we want to show the multiple statuses based on different amount of items in stock for all of the items. For that, we can use nested 'if' statements. ✅

As you can see below, the formula is perfectly working 🔽

*2. unequal() & equal()*

The 'unequal' and 'equal' functions are used to compare two values and return true if they are not equal or equal respectively. The syntax of these functions is

Let's say we want to check for items that have the exact amount of units in the inventory as needed. For that, we can simply use the 'equal' function like shown below:

As you can see below, the formula is perfectly working 🔽

Now what if we don't want to check for the items that have the exact amount of units in the inventory as needed? Say we want to check for the items that don't match the exact amount of units needed. For that, simply swap 'equal' with 'unequal'. ✅

As you can see below, the formula is perfectly working 🔽

*3. larger() & smaller()*

LARGER, SMALLER: The LARGER and SMALLER function is used to compare two numbers and return true if one number is greater than or smaller than the other. The syntax of these functions is

Say we want to see which items have excess units in the inventory. For that, we can simply use a 'larger' statement as shown below:

As you can see below, the formula is perfectly working 🔽

But what if we want to check for the items that have less amount of units than the minimum requirement? We can do that by simply swapping out 'larger' with 'smaller' as shown below:

As you can see below, the formula is perfectly working 🔽

*4. largerEq() & smallerEq()*

The 'largerEq' and 'smallerEq' functions are used to compare two numbers and return true if one number is greater than or equal to and smaller than or equal to the other respectively. The syntax of these functions is

Say we want to check for all the items that meet the minimum stock requirement as well as the items that are excess in stock. For that, we can use a simple statement with the 'largerEq' function as shown below:

As you can see below, the formula is perfectly working 🔽

Similarly, you can swap 'largerEq' with 'smallerEq' to check for items that meet the minimum stock requirement exactly and the items that need a stock refill. ✅

*Conclusion*

Now you know how to use the fist four Logic functions to build formulas in Notion! Using these functions will allow you to add a lot of features in your work space and personal space! The ability to use custom formulas in Notion databases adds another dimension to the personalisation and customizability inside Notion. So make sure you unlock the full potential of Notion with the help of formulas! 🔥

I hope this article was helpful and easy to understand. At Prototion, we are on mission to make Notion easy for everyone! So we regularly post * Helpful articles* about Notion like this one. 📄

Remember to check out theFantastic Formulasseries for more articles about Notion formulas. Doesn't matter if you are a Notion beginner or a pro, I believe you will fin this series helpful. Also, don't forget to follow us on 🐦for daily updates, latest Notion template launches and amazing deals & discounts on Premium Notion templates! 😍