# Function to round decimal numbers?

I have been using the ROUNDUP / ROUNDDOWN functions to get whole numbers, but in some cases, I need to round up to the nearest 1/4 number. How would I go about creating a function to check 24.118, and then tell the software to round it up to 24.25? Thanks kindly.

edit retag close merge delete

Sort by » oldest newest most voted

Let's talk of ROUNDing first. Let's in addition call the number you want to get integer multiples of (1/4 in your example) the MODULUS, the number you want to be rounded the ARGUMENT. What you want to get is simply named the RESULT.

Then we may state: RESULT = ROUND(ARGUMENT / MODULUS) * MODULUS

ROUND is the Calc standard function. You may use ROUNDUP and ROUNDDOWN in the same way.

For even more sophisticated rounding (neither 'nearest' nor 'up' nor 'down') you will have to use the QUOTIENT function.

more

Thanks. I have been using roundup and rounddown, and I found another one called mround, but none of those have worked quite well enough. I will check out the quotient function.

( 2015-03-28 20:15:31 +0200 )edit

I think can work rounding up with ROUND((Argument+Modulus/2-1) / Modulus) * Modulus or =MROUND(Argument+Modulus/2-1;Modulus), adding (Modulus/2-1) we get to round up.

( 2015-03-29 03:31:42 +0200 )edit

Hallo

=CEILING(A1;1/4)

=OBERGRENZE(A1;1/4)

more