Ask Your Question
0

Function to round decimal numbers?

asked 2015-03-28 16:25:43 +0200

MathGirl77 gravatar image

updated 2015-03-28 20:16:35 +0200

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 flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2015-03-28 17:37:55 +0200

Lupp gravatar image

updated 2015-03-28 17:42:24 +0200

As 'Math' doesn't round anything I suppose you are talking of spreadsheet formulae. Please add the tag 'Calc' to your question.

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.

edit flag offensive delete link more

Comments

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.

MathGirl77 gravatar imageMathGirl77 ( 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.

m.a.riosv gravatar imagem.a.riosv ( 2015-03-29 03:31:42 +0200 )edit
0

answered 2015-03-28 22:44:45 +0200

karolus gravatar image

updated 2015-03-28 22:47:51 +0200

Hallo

=CEILING(A1;1/4)

@Lupp:

=OBERGRENZE(A1;1/4)
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-03-28 16:25:43 +0200

Seen: 16,139 times

Last updated: Mar 28 '15