# Round to the nearest 10 in Excel or Open Office Calc

Is there a function, or does somebody have a formula or way of attacking these 3 problems, all in MS Excel (could also give an answer using Open Office Calc):

(1) (a) How do you round to the nearest 10?  (b) Better yet, express the answer more generally.  So, the question, ideally, is, "How do you round to the nearest x, where x = a given, real number?"

(2) (a) How do you round up to the nearest 10?  (b) Same follow-up as in question (1).

(3) (a) How do you round down to the nearest 10?  (b) Same follow-up as in question (1).

I have Excel 2003.  I'd prefer an answer in Excel to one requiring Open Office Calc, but if there's a much easier way to do it in the latter, I'd be very interested in knowing that fact.  It will probably be easiest to follow this thread if people specify which problem they're addressing, for example, "Problem (2b)".

Thanks.

Last Comment
Tracy

8/22/2022 - Mon
SOLUTION
pritamdutt

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Ingeborg Hawighorst (Microsoft MVP / EE MVE)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Ingeborg Hawighorst (Microsoft MVP / EE MVE)

You can use MOD() in an IF statement to decide whether to round up or down

=IF(MOD(A1/10,1)>=0.5,CEILING(A1,10),FLOOR(A1,10))

10       -->      10
11       -->      10
12       -->      10
13       -->      10
14       -->      10
15       -->      20
16       -->      20
17       -->      20
18       -->      20
19       -->      20
20       -->      20

cheers, teylyn
SOLUTION
barry houdini

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
therearestupidquestions

Whoops!  Sorry.  I forgot I had this question open.  Let me try to review this stuff today.  I hope I have time to get to it.
SOLUTION
Saqib Husain

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
barry houdini

=INT((number+x)/x)*x

Hello Saqib,

I don't think that will work if number is a multiple of x, e.g. if number is 18 and x is 6 you'd expect a roundup function to return 18...but that would return 24.....

regards, barry
Saqib Husain

Thanks, Barry, I did not realize that.

Maybe we can modify it to

=INT((\$F2+G\$1*0.99999999)/G\$1)*G\$1

therearestupidquestions

I'm raising the point value to reward experts for their patience.

I'll review answers and award points ASAP.  I may have to post another post along these lines, before that time, to keep the question active.  However, I do appreciate people's responses, and nobody will be cheated out of points they deserve.  You just may have to wait a bit.

therearestupidquestions

I bumped up the points to reward ongoing patience.

Thanks for waiting.
therearestupidquestions

Again, I bumped up the points.

Thanks, all.
Ingeborg Hawighorst (Microsoft MVP / EE MVE)

You said above:

So, did you review the options presented? What is your result?
Saqib Husain

Hi teylyn, I think the OP is not yet ready to review the options. "No more comments..." could be because EE stalls the asker's ability to ask more questions if the experts' comments are waiting long enough.

Saqib
therearestupidquestions