How to use the IF function in Airtable formulas
Tips & Tricks

How to use the IF function in Airtable formulas

Test your inputs with the great and powerful “IF.”

IF functions (sometimes known as “IF statements”) may sound intimidating, but they're actually one of the most commonly used functions in databases and spreadsheets–and they can do a lot of heavy lifting for companies looking to gleam insights about their data.

In a formula, they let you compare inputs and take one action if the result is true, or another action if the result is false. The idea of “if” comes up in all kinds of logical choices. For example: “If I follow the yellow brick road, I’ll get to see the Wizard of Oz.” If an input is true, you follow the yellow road and see the wizard. If the input is false and you choose not to follow the road, you don’t see the wizard at all.

Here’s another example that might apply to your organization: say you’re in the middle of several large marketing campaigns. You’d like to know which of them have budgets over $50,000 and which are under. Applying an IF function can give you that insight, showing which inputs meet the $50,000 threshold and which do not.

In Airtable, an IF function lets you compare:

  • dates
  • values
  • text strings
  • text fields
  • numeric fields
  • or any other field

To use an IF function in Airtable, you’ll need to create a new field. You can do so by scrolling to the right of your base in any grid view and clicking the "+" icon. Give it a descriptive name, then choose the field type “Formula.”

This calls up a box where you can write your formula.

Let’s say you want to check on the status of various tasks you’re managing. To run a formula that shows what’s completed vs what’s in progress, the IF function will look like this:

IF({% Complete} = 0, “Not started”, “In progress”)

But then you want to run an even more complex test.

Sticking with our status check example, perhaps you want to know: among the projects in progress, which are more than 50% complete? You can display the answer using a nested IF, which you’ll also type into the formula box. A nested IF lets you add more parameters to check.

IF({% Complete} = 0, “Not started”, IF({% Complete} = 1, “Done”, “In progress”))

At the end of any project, an IF function is a great way to measure its success. How many sprints were completed? How much over budget did you go? Because you can compare dates, text, or numbers, the IF function can help you calculate it all.

Use these takeaways to improve your processes and nail the next campaign, launch, or project.

For more on formulas, check out our Essentials of Formulas guide. Then, create a formula in your base.

More for the record