Notion’s powerful database capabilities are further enhanced by its robust formula options. Among these, the `IFS`

formula stands out for its ability to handle complex conditional logic with ease.

In this blog post, we will explore the `IFS`

function, demonstrate practical real-world examples, and show you how to combine it with other formulas like `AND`

, `OR`

, and `CONTAINS`

to supercharge your Notion workflows.

## What is the IFS Formula?

The `IFS`

formula in Notion allows you to evaluate multiple conditions and return a corresponding value for the first true condition. It works similarly to a series of `IF`

statements but is more streamlined and easier to read.

### Basic Syntax

The basic syntax for the `IFS`

formula is:

`if(condition1, value1, condition2, value2, ..., conditionN, valueN)`

`condition1`

,`condition2`

, …,`conditionN`

are the conditions you want to evaluate.`value1`

,`value2`

, …,`valueN`

are the values to return when their corresponding conditions are true.

## Practical Real-World Examples

### Example 1: Task Priority

Let’s say you have a task database, and you want to set the priority of tasks based on their due dates. You can use the `IFS`

formula to achieve this.

- Add a new formula property called “Priority”.
- Use the following formula:

`ifs(dateBetween(prop("Due Date"), now(), "days") <= 1, "High",`

dateBetween(prop("Due Date"), now(), "days") <= 3, "Medium",

"Low")

This formula checks the number of days between the current date and the due date:

- If the task is due in 1 day or less, it sets the priority to “High”.
- If the task is due in 3 days or less, it sets the priority to “Medium”.
- Otherwise, the priority is set to “Low”.

### Example 2: Project Status

Consider a project management database where you want to set the project status based on completion percentage.

- Add a new formula property called “Status”.
- Use the following formula:

`ifs(prop("Completion") == 100, "Completed",`

prop("Completion") >= 75, "Almost Done",

prop("Completion") >= 50, "In Progress",

prop("Completion") >= 25, "Started",

"Not Started")

This formula evaluates the completion percentage and sets the status accordingly:

- 100% completion sets the status to “Completed”.
- 75% or more sets the status to “Almost Done”.
- 50% or more sets the status to “In Progress”.
- 25% or more sets the status to “Started”.
- Anything less than 25% sets the status to “Not Started”.

## Combining IFS with AND and OR

You can make your IFS formulas even more powerful by combining them with `AND`

and `OR`

operators.

### Example 3: Conditional Task Urgency

Let’s enhance our task priority example to also consider the task status.

- Add a new formula property called “Urgency”.
- Use the following formula:

`ifs(`

and(dateBetween(prop("Due Date"), now(), "days") <= 1, prop("Status") != "Completed"), "High",

and(dateBetween(prop("Due Date"), now(), "days") <= 3, prop("Status") != "Completed"), "Medium",

"Low"

)

This formula sets the urgency based on due date and status:

- If the task is due in 1 day or less and not completed, the urgency is “High”.
- If the task is due in 3 days or less and not completed, the urgency is “Medium”.
- Otherwise, the urgency is “Low”.

### Example 4: Employee Performance Review

Consider a human resources database where you want to categorize employee performance based on their rating and the number of projects completed.

- Add a new formula property called “Performance Category”.
- Use the following formula:

`if(`

and(prop("Rating") >= 4.5, prop("Projects Completed") >= 10), "Outstanding",

and(prop("Rating") >= 4.0, prop("Projects Completed") >= 7), "Exceeds Expectations",

and(prop("Rating") >= 3.0, prop("Projects Completed") >= 5), "Meets Expectations",

"Needs Improvement"

)

This formula categorizes employee performance based on rating and projects completed:

- A rating of 4.5 or higher and 10 or more projects completed sets the category to “Outstanding”.
- A rating of 4.0 or higher and 7 or more projects completed sets the category to “Exceeds Expectations”.
- A rating of 3.0 or higher and 5 or more projects completed sets the category to “Meets Expectations”.
- Anything else is categorized as “Needs Improvement”.

### Example 5: Task Urgency with OR Condition

Let’s say you want to set the urgency of a task based on whether it’s either due soon or has a high priority.

- Add a new formula property called “Urgency”.
- Use the following formula:

`if(`

or(dateBetween(prop("Due Date"), now(), "days") <= 1, prop("Priority") == "High"), "High",

or(dateBetween(prop("Due Date"), now(), "days") <= 3, prop("Priority") == "Medium"), "Medium",

"Low"

)

This formula sets the urgency based on due date or priority:

- If the task is due in 1 day or less or has a high priority, the urgency is “High”.
- If the task is due in 3 days or less or has a medium priority, the urgency is “Medium”.
- Otherwise, the urgency is “Low”.

### Example 6: Employee Performance Review with AND and OR Conditions

Consider a human resources database where you want to categorize employee performance based on their rating and the number of projects completed, with an additional consideration for any recent commendations.

- Add a new formula property called “Performance Category”.
- Use the following formula:

`if(`

and(or(prop("Rating") >= 4.5, prop("Recent Commendation") == true), prop("Projects Completed") >= 10), "Outstanding",

and(or(prop("Rating") >= 4.0, prop("Recent Commendation") == true), prop("Projects Completed") >= 7), "Exceeds Expectations",

and(prop("Rating") >= 3.0, prop("Projects Completed") >= 5), "Meets Expectations",

"Needs Improvement"

)

This formula categorizes employee performance based on rating, projects completed, and recent commendations:

- A rating of 4.5 or higher or a recent commendation, and 10 or more projects completed, sets the category to “Outstanding”.
- A rating of 4.0 or higher or a recent commendation, and 7 or more projects completed, sets the category to “Exceeds Expectations”.
- A rating of 3.0 or higher and 5 or more projects completed sets the category to “Meets Expectations”.
- Anything else is categorized as “Needs Improvement”.

## Combining IFS with Other Formulas

The `IFS`

formula can also be combined with other formulas to create even more dynamic and powerful expressions.

### Example 7: Task Category

Let’s use the `CONTAINS`

function in combination with the `IFS`

formula to categorize tasks based on keywords in the task name.

- Add a new formula property called “Category”.
- Use the following formula:

`ifs(`

contains(prop("Task Name"), "Report"), "Reporting",

contains(prop("Task Name"), "Email"), "Communication",

contains(prop("Task Name"), "Meeting"), "Meetings",

"Other"

)

This formula categorizes tasks based on keywords in the task name:

- If the task name contains “Report”, the category is “Reporting”.
- If the task name contains “Email”, the category is “Communication”.
- If the task name contains “Meeting”, the category is “Meetings”.
- Otherwise, the category is “Other”.

### Example 8: Advanced Expense Categorization

Consider a personal finance database where you want to categorize expenses based on both description and amount.

- Add a new formula property called “Expense Category”.
- Use the following formula:

`if(`

and(contains(prop("Description"), "Grocery"), prop("Amount") > 100), "High Grocery",

contains(prop("Description"), "Grocery"), "Grocery",

and(contains(prop("Description"), "Rent"), prop("Amount") > 1000), "High Rent",

contains(prop("Description"), "Rent"), "Rent",

"Miscellaneous"

)

This formula categorizes expenses based on the description and amount:

- If the description contains “Grocery” and the amount is greater than $100, the category is “High Grocery”.
- If the description contains “Grocery”, the category is “Grocery”.
- If the description contains “Rent” and the amount is greater than $1000, the category is “High Rent”.
- If the description contains “Rent”, the category is “Rent”.
- Otherwise, the category is “Miscellaneous”.

## Conclusion

The `IFS`

formula in Notion can handle complex conditional logic with ease. By combining it with `AND`

, `OR`

, `CONTAINS`

, and other formulas, you can create dynamic and powerful workflows tailored to your specific needs.

Experiment with these examples and see how you can apply them to optimize your Notion setup.

Happy Notion-ing!