Multiples of 5

beenay

New Member
Joined
Oct 9, 2002
Messages
10
I need to round a number to it's nearest multiple of 5. Example: 15 would equal 15, 16 would equal 15, 17 would equal 15, 18 would equal 20, 19 would equal 20, and 20 would equal 20.

CEILING and FLOOR don't work because they either always round up, or always round down.
This message was edited by beenay on 2002-10-11 12:14
This message was edited by beenay on 2002-10-11 12:20
This message was edited by beenay on 2002-10-11 12:27
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

ChrisUK

Well-known Member
Joined
Sep 3, 2002
Messages
675
Use mod instead

A1-mod(A1,5)

If A1=6 your answer would be 5
If A1=5 your answer would be 5
If A1=17 your answer would be 15

Only problem would be if it was les than 5, then you get 0. If this was a problem you would have to test for 0 using if.

HTH

Chris
 

marnie

Board Regular
Joined
Apr 26, 2002
Messages
86
=MROUND(A1,5)

If cell A1 has a 2 in it, a zero will return, if A1 has a 3 in it, a 5 will return. You may need to choose an add-in option from the tools menu to make this work. The add-in is "Analysis ToolPak"
 

Richie(UK)

MrExcel MVP
Joined
May 17, 2002
Messages
3,329
Hi,

Only tested this briefly, but how about:

=(ROUND((A1/5),0)*5)

where the number to be rounded is in A1.

HTH
 

beenay

New Member
Joined
Oct 9, 2002
Messages
10

ADVERTISEMENT

MOD doesn't work because it always rounds down. 18 is returned as 15, when it should be returned as 20.
 

beenay

New Member
Joined
Oct 9, 2002
Messages
10
Richie,

That did it!!! Thank you so much.

Thanks to the other suggestions too.

Brandon
 

T. Cabin

New Member
Joined
Oct 10, 2002
Messages
2
On 2002-10-11 12:27, beenay wrote:
MOD doesn't work because it always rounds down. 18 is returned as 15, when it should be returned as 20.

To use MOD, the formula would have to be something like :-

=IF(MOD(A1,5)<3,A1-MOD(A1,5),A1-MOD(A1,5)+5)

=MROUND(A1,5) and =ROUND((A1/5),0)*5 are better alternatives.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
On 2002-10-11 12:31, beenay wrote:
Richie,

That did it!!! Thank you so much.

Thanks to the other suggestions too.

Brandon

Although I prefer myself the ROUND version, you should also check

=MROUND(A1,5)

Marnie proposed...
 

Forum statistics

Threads
1,144,510
Messages
5,724,782
Members
422,578
Latest member
annsalinas

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top