IF, ROUNDUP Function

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?

Welcome to the community, @Joel_Kay! :smiley: 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.

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))

1 Like

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.” :slight_smile:

1 Like

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.