PC Review


Reply
Thread Tools Rate Thread

Convert number to nearest multiple of Five

 
 
Abdul
Guest
Posts: n/a
 
      16th Jul 2007
Hello,

Is there a way that I can convert a number to its nearest multiple of
5?

like in A1.. A5 i have

281
288
291
297
298

I want in B1 .. B5

280
290
290
295
300

That is up the number or down to nearest multiples of five

Thanks

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmltIFRob21saW5zb24=?=
Guest
Posts: n/a
 
      16th Jul 2007
You can use a formula like this...

=ROUND(A1/5,0)*5

Where 281 is in cell A1 it will return 280
--
HTH...

Jim Thomlinson


"Abdul" wrote:

> Hello,
>
> Is there a way that I can convert a number to its nearest multiple of
> 5?
>
> like in A1.. A5 i have
>
> 281
> 288
> 291
> 297
> 298
>
> I want in B1 .. B5
>
> 280
> 290
> 290
> 295
> 300
>
> That is up the number or down to nearest multiples of five
>
> Thanks
>
>

 
Reply With Quote
 
=?Utf-8?B?Sm9obiBCdW5keQ==?=
Guest
Posts: n/a
 
      16th Jul 2007
The MROUND function is what you want, you have to go to Tools, Addins, and
add the analysis toolpack if you don't already, then

=MROUND(A1,5)
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Abdul" wrote:

> Hello,
>
> Is there a way that I can convert a number to its nearest multiple of
> 5?
>
> like in A1.. A5 i have
>
> 281
> 288
> 291
> 297
> 298
>
> I want in B1 .. B5
>
> 280
> 290
> 290
> 295
> 300
>
> That is up the number or down to nearest multiples of five
>
> Thanks
>
>

 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      16th Jul 2007
> Is there a way that I can convert a number to its nearest multiple of
> 5?
>
> like in A1.. A5 i have
>
> 281
> 288
> 291
> 297
> 298
>
> I want in B1 .. B5
>
> 280
> 290
> 290
> 295
> 300
>
> That is up the number or down to nearest multiples of five


Use this...

=MROUND(A1,5)

and copy down.

Rick
 
Reply With Quote
 
gimme_this_gimme_that@yahoo.com
Guest
Posts: n/a
 
      17th Jul 2007
Hey Abdul,

Homey!!!

VBRound can be used to round to the nearest "whatever" called with the
right argument of 5 it rounds to the nearest 5.

VBRound can be used from VBScript too.

Sub testVBRound()
v = Array(281, 288, 291, 297, 298)
For i = 0 To 4
MsgBox VBRound(v(i), 5)
Next i
End Sub

Function VBRound(a, b)
Result = ""
If 0 = b Then
Result = ""
ElseIf "" = b Then
Result = a
ElseIf 0 = a Then
Result = 0
Else
Result = b * ((a \ b) - CInt(((a Mod b) >= (b / 2))))
End If
VBRound = Result
End Function


 
Reply With Quote
 
Bernd P
Guest
Posts: n/a
 
      17th Jul 2007
=ROUND(A1*2,-1)/2

Regards,
Bernd

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert T/F to Number value & Sum multiple fields for further calc Aso Microsoft Access 3 18th May 2009 04:33 AM
Excel. How to round a number to nearest half number? =?Utf-8?B?SGFyYWxkUw==?= Microsoft Excel Misc 2 19th Feb 2007 09:50 AM
HOW DO I ROUND A NUMBER TO THE NEAREST MULTIPLE OF 5? =?Utf-8?B?QUxDSUQ=?= Microsoft Excel Misc 4 28th Sep 2004 01:31 AM
How to round number to the nearest multiple of signifiance? Air2000 Microsoft Excel Misc 3 17th Sep 2004 10:08 AM
convert number to a set multiple of that number =?Utf-8?B?Q0I=?= Microsoft Excel Misc 2 24th Oct 2003 08:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:08 AM.