The IF function will return one of two values depending on whether a logical argument is true or not. Written in the format:

IF([logical argument], [value1], [value2])

this function basically means "If [logical argument is true], then return [value1]. Otherwise, return [value2]."

The logical argument can be either text or a value, e.g.

{Pet's Name}="Rufus"

{Test Score}>75

Example 1 (single IF):

*If the number in the {Number of tasks} field is greater than 4, return the text string "Overworked! 😩", otherwise, return nothing. *

IF({Number of Tasks}>4, "Overworked! 😩", "")

On its own, an IF function can only have two results—either the logical argument is true, or the logical argument is false. Putting an IF function inside of another IF function can make it so that your formula can output more than two responses.

IF([logical argument1], [value1], IF([logical argument2], [value2], [value3]))

This function means "If [logical argument 1 is true], then return [value1]. Otherwise, if [logical argument 2 is true], then return [value2]. Otherwise, return [value3]."

This can be represented in a chart:

Example 2 (two IFs):

For this example, any student who received a test score greater than 80 will get "Exceeds expectations ✅", any student who received a test score less than 80 will get "Does not meet expectations ❌", and any student who received a test score of exactly 80 will get "Meets expectations..."

*If the number in the {Test Score} field is greater than 80, return the text string "Exceeds expectations ✅". Otherwise, if the number in the {Test Score} field is not greater than 80, and it is less than 80, return "Does not meet expectations ❌". Otherwise, if the number in the {Test Score} field is not greater than 80, and it is also not less than 80, return "Meets expectations...".*

IF({Test Score} > 80, "Exceeds expectations ✅",IF({Test Score} < 80, "Does not meet expectations ❌","Meets expectations..."))

Airtable can support many, many nested IF functions, though be warned that it becomes very difficult to track mistakes in a formula as IF functions pile on top of each other.

Example 3 (Even more IFs):

In this example, a group of students have taken a test with a score out of 100 points.

- If the value in the {Score} field is less than 70 and greater than or equal to 0, return "❌ Does not meet expectations ❌"
- If the value in the {Score} field is greater than or equal to 70, and less than 90, return "👌Meets expectations👌"
- If the value in the {Score} field is greater than or equal to 90, and less than or equal to 100, return "✅ Exceeds expectations ✅"
- If the value in the {Score} field is somehow less than 0, or greater than 100, return "Error!"

We need to write a series of IF functions that can return all four possible outcomes, but the catch is that we can only write logical arguments with one operator—e.g., we cannot have "0<{Score}<70" as the logical argument in an IF. Therefore, we need to break down this problem into a series of logical arguments that have only one operator.

One way of doing this is represented by the diagram below:

The formula reflecting this series of logical arguments, therefore, looks like this:

IF(Score < 0, "Error!",IF(Score < 70, "❌ Does not meet expectations ❌",IF(Score < 90, "👌Meets expectations👌",IF(Score <= 100, "✅ Exceeds expectations ✅","Error!"))))