Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

Can't Get Nested IF AND Statements to Work

Topic Labels: Formulas
Solved
Jump to Solution
307 3
cancel
Showing results for 
Search instead for 
Did you mean: 
emdeesee
4 - Data Explorer
4 - Data Explorer

Hello Airtable community!

I inherited a pretty robust Airtable system from a predecessor and have been working to revamp it, but my formula skills are not as good as the person who came before me, and I've been struggling to get IF AND statements to work. The logic seems sound, but they keep returning empty cells.

One of the ones I'm struggling with concerns a formula that should return 1 of 2 options if a cell has a specific entry. I can get a single IF statement to return the correct result, but as soon as I try to include an AND, it fails. Here's what I have so far:

In my table, the formula field is 'Ship From' with the two options being 'Direct from Printer' or 'X Distributor'. I want the formula to return 'Direct from Printer' if another field - 'Role' - is one of 3 options: Marketing/Sales, Licensor, or Editor in Chief. All other Roles should return 'X Distributor.'

So I put in:

 
IF(AND({Role}="Marketing/Sales",
IF(AND({Role}="Licensor",
IF(AND({Role}="Editor in Chief","Printer","X Distributor"))))
 
Should it be an OR statement? Please tell me what I'm missing.
1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

The word order in Airtable formula language is different from the word order in English.

IF(
  OR(
    {Role}="Marketing/Sales",
    {Role}="Licensor",
    {Role}="Editor in Chief"
  ),
  "Printer",
  "X Distributor"
)

See Solution in Thread

3 Replies 3
kuovonne
18 - Pluto
18 - Pluto

The word order in Airtable formula language is different from the word order in English.

IF(
  OR(
    {Role}="Marketing/Sales",
    {Role}="Licensor",
    {Role}="Editor in Chief"
  ),
  "Printer",
  "X Distributor"
)
Marvel
4 - Data Explorer
4 - Data Explorer

You're very close, but the issue is in how you're using the AND function. Instead of AND, you should use OR because you want to check if {Role} is any of the three options, not all at once. Here’s the correct formula:

IF(OR({Role}="Marketing/Sales", {Role}="Licensor", {Role}="Editor in Chief"), "Direct from Printer", "X Distributor")

This means:

  • If {Role} is either "Marketing/Sales," "Licensor," or "Editor in Chief," it will return "Direct from Printer."
  • If it's anything else, it will return "X Distributor."

Try this, and let me know if you need more help! 😊

emdeesee
4 - Data Explorer
4 - Data Explorer

Thank you both, I got it!