Nested If Frustration

I am trying to create a nested if formula. I am trying to build the following formula:

  • If a # value is over 1,000,000, the field would fill with “Mega Influencer”
  • If a # value is 100,000-999,999, the field would fill with “Macro Influencer”
  • If a # value is 10,000-99,999, the field would fill with “Micro Influencer”
  • If a # value is 1,000-9,999, the field would fill with “Nano Influencer”
  • If a # value is BLANK, the field would fill with “Need to add follower count”

I have come up with the following formula and it is not working:
image

You have 4 opening parentheses, but 8 closing parentheses.

Delete 4 of those closing parentheses and I think you’ll be good.

Unfortunately, that still didn’t work :weary:

Maybe if you share a screenshot of the table we can help better.

I would also suggest to make sure the Followers field is set as a Number not as a Text. Sometimes it happens :slight_smile:

Hi @Natalie_Lodwig - nested IF statements are always tricky - so easy to miss a comma or bracket. Here’s my method for getting them to work.

Firstly, don’t edit them in the Airtable formula field, but use a text editor, preferably one designed for coding (I use Atom). Copy into the field formula box when done.

Then start with a simple IF:

Screenshot 2020-01-11 at 07.08.10

(copy this into the AT field to check that it works if you want).

Now, copy this formula, enter a comma and new line after “Large” and paste what you have copied on the new line:

Screenshot 2020-01-11 at 07.10.04

modifying the argument and the resulting value:

Screenshot 2020-01-11 at 07.13.17

Repeat this process as many times as needed.

Looking at your screenshot there’s two problems - 1) Number of brackets as per @Jeremy_Oglesby and 2) you have a comma after “Nano influencer”. This comma should be removed. If it is present the formula is expecting an explicit “final” value. As an example, this works:

IF(
  Number >= 1000, 
  'Large',
  IF(
    Number >= 100, 
    'Medium',
    IF(
      Number >= 10, 
      'Small'
    )
  )
) 

But this doesn’t:

IF(
  Number >= 1000, 
  'Large',
  IF(
    Number >= 100, 
    'Medium',
    IF(
      Number >= 10, 
      'Small',
    )
  )
)

JB

1 Like

Um, the four parens is just a start - you also need to provide a value following the final comma - i.e., to support the case where the # of followers is < 1000. That dangling comma is probably what’s causing it to fail.

Thank you so much for this thorough response. I finally got it to work following your instructions. Really appreciate your help. Have a wonderful day!

1 Like

This is exactly it. Thank you!