Help

IF, ROUNDUP Function

Topic Labels: Formulas
Solved
Jump to Solution
757 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Joel_Kay
4 - Data Explorer
4 - Data Explorer

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?

1 Solution

Accepted Solutions

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:

See Solution in Thread

3 Replies 3

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.

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

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: