May 23, 2022 09:37 AM
Hello,
I’m trying to do a fairly basic calculation that is conditional on a percentage field - if the percent is above a threshold, return a calculated number, if below return 0. My formula works with anything except zero for value 2.
Here’s my formula:
IF(
(Potential*100) >= 490,
{Estimated Points}*Potential,
0
)
Any help greatly appreciated.
May 23, 2022 03:40 PM
Hi @Phil_Vallender
What is the error that you are getting?
May 23, 2022 06:09 PM
Welcome to the community, @Phil_Vallender! :grinning_face_with_big_eyes:
Could you please clarify what you mean by this? Which value is “value 2”?
Going off of your subject line—re: the formula not returning an integer—one thing to keep in mind is that you can control the display formatting of a formula that outputs a numeric value. To adjust this, open the formula field settings, then click on the “Formatting” tab. There you can choose whether the field displays a decimal value or an integer.
Keep in mind that this formatting control is for display purposes only. Internally the calculated value is likely stored as a decimal, and will return as such to any other formula that asks for it. If you want other formulas to treat the output from this one as a whole number, wrap your current formula in one of Airtable’s rounding functions.
May 24, 2022 01:28 AM
Hey! Sorry, by ‘value 2’ I mean the return value from the IF state when false.
When false, I want the IF statement to simply return 0 (as a number).
May 24, 2022 01:33 AM
Here’s my formula:
The red squiggle error says missing parenthesis (but adding doesnt seem to fix).
Basically the formula seems to work when both return Value 1 and Value 2 are either text or other fields, but as soon as I enter 0, all results go to 0 too!
Thanks.
May 25, 2022 02:47 AM
Hey! Sorry, by ‘value 2’ I mean the return value from the IF state when false.
When false, I want the IF statement to simply return 0 (as a number).
May 25, 2022 07:55 PM
I saw your reply the first time. No need to repeat it. :slightly_smiling_face:
That’s very strange. The formula syntax looks fine. I created that same formula myself and didn’t get any error indicator.
The first thing to try is to shut down and restart your browser (or the standalone app if that’s what you’re using). Sometimes a browser that’s left open too long can cause unexpected things to happen with Airtable. I’ve seen it firsthand on more than one occasion, and a restart of the browser is the only thing that will cure some ailments.
If that doesn’t fix it, try retyping the formula from scratch in a new formula field. If it gives the same error there, definitely report it to Airtable support.
I wish that I had more to suggest, but this is truly one of the most bizarre errors I’ve seen.
May 26, 2022 06:05 AM
Yeah, sorry about that - first time didnt show as being a reply to your post, so I thought I’d better retry.
Will look again and see if the formula can be fixed based on your suggestions.
Thanks.
May 26, 2022 06:56 PM
I appreciate the thought, but I saw it even though it wasn’t a direct reply to my comment. My participation in the thread meant that I’d receive certain notifications anyway.
Looking forward to seeing how this turns out!