Aug 23, 2021 01:00 PM
Hello, I am trying to write an equation for total pallets used. If the total cartons is over 4it gets palletized. My equation is IF(Cartons > 4, ROUNDUP(Cartons/{Cartons per Pallet}), 0)
. but Airtable wont accept it. Any advice?
Solved! Go to Solution.
Aug 24, 2021 08:26 AM
I saw that shifted parenthesis, but wasn’t sure about mentioning it. Some functions have optional arguments, and I couldn’t recall from prior experience if that last argument fell into that category, so that might have indicated the fallback value for the IF()
function. I should’ve just looked at the documentation for ROUNDUP()
, where it says, “You must give a value for the precision or the function will not work.” :slightly_smiling_face:
Aug 23, 2021 01:44 PM
Welcome to the community, @Joel_Kay! :grinning_face_with_big_eyes: What type of field is {Cartons}
? If it’s a lookup field, you’re most often dealing with an array of values, not a single value. In some cases Airtable will auto-convert a one-item array into a single data value, but not always (see this base that I made for more info on what each field type returns, including when collected by a lookup field).
If it’s not a lookup, please share more details and we can go from there.
Aug 24, 2021 07:58 AM
Thanks Justin. Cartons is another formula running off other data in the field. I believe I got it situated by moving the parenthesis at the end of “{Cartons per Pallet}” to the end of the equation to read: IF(Cartons > 4, ROUNDUP(Cartons/{Cartons per Pallet}, 0))
Aug 24, 2021 08:26 AM
I saw that shifted parenthesis, but wasn’t sure about mentioning it. Some functions have optional arguments, and I couldn’t recall from prior experience if that last argument fell into that category, so that might have indicated the fallback value for the IF()
function. I should’ve just looked at the documentation for ROUNDUP()
, where it says, “You must give a value for the precision or the function will not work.” :slightly_smiling_face: