Jan 10, 2020 03:54 PM
I am trying to create a nested if formula. I am trying to build the following formula:
I have come up with the following formula and it is not working:
Jan 10, 2020 08:50 PM
You have 4 opening parentheses, but 8 closing parentheses.
Delete 4 of those closing parentheses and I think you’ll be good.
Jan 10, 2020 09:19 PM
Unfortunately, that still didn’t work :weary:
Jan 10, 2020 10:51 PM
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 :slightly_smiling_face:
Jan 10, 2020 11:19 PM
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:
(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:
modifying the argument and the resulting value:
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
Jan 11, 2020 06:52 AM
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.
Jan 11, 2020 07:00 AM
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!
Jan 11, 2020 09:32 PM
This is exactly it. Thank you!