Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Cowtoon
 
Posts: n/a
Default Round up to nearest 10

Is there a function that will allow me to round up to the nearest 10, i.e.
214 would be 220, 253 would become 260.
I have no idea if that can be done.
Would appreciate your insights.
Thanks.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Round up to nearest 10

=roundup(A1,-1)

or

=CEILING(A1,10)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Cowtoon" wrote in message
...
Is there a function that will allow me to round up to the nearest 10, i.e.
214 would be 220, 253 would become 260.
I have no idea if that can be done.
Would appreciate your insights.
Thanks.




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Cowtoon
 
Posts: n/a
Default Round up to nearest 10

Thank you Bob, Ron.

Does this obviously mean that I'll need an extra column for this to occur
and be visible. I guess there isn't a function that would work without the
extra cells. I was hoping I could set the function up with this parameter
and just type in the value and have it show in the same cell.

Your thoughts are welcome.
If not ... I'll use your solution as it does work ... but need to add an
extra column for it to work.
Thanks.
Diana

"Bob Phillips" wrote in message
...
=roundup(A1,-1)

or

=CEILING(A1,10)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Cowtoon" wrote in message
...
Is there a function that will allow me to round up to the nearest 10, i.e.
214 would be 220, 253 would become 260.
I have no idea if that can be done.
Would appreciate your insights.
Thanks.





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Round up to nearest 10

Yes it does mean an extra column, functions cannot work on the same cell
that contains the data, they would wipe the data.

You could use event code

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
.Value = Application.RoundUp(.Value, -1)
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.





--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Cowtoon" wrote in message
...
Thank you Bob, Ron.

Does this obviously mean that I'll need an extra column for this to occur
and be visible. I guess there isn't a function that would work without

the
extra cells. I was hoping I could set the function up with this parameter
and just type in the value and have it show in the same cell.

Your thoughts are welcome.
If not ... I'll use your solution as it does work ... but need to add an
extra column for it to work.
Thanks.
Diana

"Bob Phillips" wrote in message
...
=roundup(A1,-1)

or

=CEILING(A1,10)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Cowtoon" wrote in message
...
Is there a function that will allow me to round up to the nearest 10,

i.e.
214 would be 220, 253 would become 260.
I have no idea if that can be done.
Would appreciate your insights.
Thanks.







  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Cowtoon
 
Posts: n/a
Default Round up to nearest 10

Thanks Bob,
What I think I'll do is put the rounded values in a different worksheet.
that would work best for me, rather than having too many columns in view.

Thanks so much for your help ... appreciated

"Bob Phillips" wrote in message
...
Yes it does mean an extra column, functions cannot work on the same cell
that contains the data, they would wipe the data.

You could use event code

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
.Value = Application.RoundUp(.Value, -1)
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.





--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Cowtoon" wrote in message
...
Thank you Bob, Ron.

Does this obviously mean that I'll need an extra column for this to occur
and be visible. I guess there isn't a function that would work without

the
extra cells. I was hoping I could set the function up with this parameter
and just type in the value and have it show in the same cell.

Your thoughts are welcome.
If not ... I'll use your solution as it does work ... but need to add an
extra column for it to work.
Thanks.
Diana

"Bob Phillips" wrote in message
...
=roundup(A1,-1)

or

=CEILING(A1,10)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Cowtoon" wrote in message
...
Is there a function that will allow me to round up to the nearest 10,

i.e.
214 would be 220, 253 would become 260.
I have no idea if that can be done.
Would appreciate your insights.
Thanks.










  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Round up to nearest 10

For a value in A1
B1: =CEILING(A1,10)

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


"Cowtoon" wrote:

Is there a function that will allow me to round up to the nearest 10, i.e.
214 would be 220, 253 would become 260.
I have no idea if that can be done.
Would appreciate your insights.
Thanks.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Round a number to the Nearest .25 Dave E Excel Worksheet Functions 3 May 15th 23 11:47 AM
How do i round up a price to the nearest 5,10,15 etc pence Millsy Excel Worksheet Functions 1 May 18th 05 02:20 PM
i need an excell formula that will round up to the nearest 9.99 Brian Excel Worksheet Functions 4 May 11th 05 10:51 PM
Round Up to Nearest 10 Marek Excel Worksheet Functions 4 April 29th 05 01:16 PM
Round time to nearest quarter hr John Excel Worksheet Functions 2 March 16th 05 09:41 PM


All times are GMT +1. The time now is 09:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"