Airtable Cobuilder is here! Learn more about our new no-code app creation feature, powered by AI on the Airtable Academy

Re: Rounding formula problem

444 0
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

I need to round off a list of values ​​to 0.5
With the formula “Ceiling” they all go with the highest value, instead I need that the values ​​under 0.25 or upper 0.75 etc must go to 0.

With the “Round” formula I can’t understand where I’m wrong.
I’m using Round ({column of values}, 0.5)

Tnx in advance

1 Reply 1
10 - Mercury
10 - Mercury

Hi there @Matteo_Bersan!

This seems to be a bit more complicated than one would think. I think the below might do the trick…

IF({Input}, IF(ABS({Input} - CEILING({Input}, .5)) < ABS({Input} - FLOOR({Input}, .5)), {Input} + ABS({Input} - CEILING({Input}, .5)), {Input} - ABS({Input} - FLOOR({Input}, .5))))

This makes use of both the CEILING() and FLOOR() functions to compare which is closer to the original {Input}. I think ROUND() is looking for an integer as a precision value, where as FLOOR() and CEILING() will accept decimals.

Hope this helps! :slightly_smiling_face: