Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rounding a value to the nearest 50

Tags:

rounding

excel

I want to round values to its nearest 50. For e.g.

121 should get rounded to 100
129 should get rounded to 150
178 should get rounded to 200
165 should get rounded to 150

I have tried the following functions...

=FLOOR(C629,50)
=FLOOR((C629+50),50)
=CEILING(C631,50)

But I am still not getting the results as expected.

like image 797
shantanuo Avatar asked Feb 27 '23 02:02

shantanuo


2 Answers

From the examples you have provided, it appears that you want to move each number to the nearest multiple of 50.

This function should accomplish this:

=ROUND(C629 / 50 , 0) * 50

This works in the following manner for 129:

  1. 129 / 50 = 2.58
  2. ROUND(2.58 , 0) = 3
  3. 3 * 50 = 150

EDIT: The OP's comment to use the in-built MROUND is a much better idea.

like image 144
Ani Avatar answered Mar 02 '23 15:03

Ani


For clarity, the simplest answer is MROUND, e.g.:

=MROUND(589,50)

This solution was submitted in a comment by shantanuo.

like image 40
Aske B. Avatar answered Mar 02 '23 14:03

Aske B.