Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Rounding down numbers in cell

I'm trying to format a cell to round numbers DOWN as I type them.
Right now, Excel seems to only round numbers UP. Is there any way to
do this without using the ROUNDDOWN formula? I know I can use the
ROUNDDOWN formula, but that only works if he formula is in a different
cell from the data. Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Rounding down numbers in cell

You can never get Excel to round numbers by using formatting, the display
rounds up or down depending on the number, however the underlying value is
still the same. You can only get this upon entry by using an event macro


--
Regards,

Peo Sjoblom



wrote in message
ups.com...
I'm trying to format a cell to round numbers DOWN as I type them.
Right now, Excel seems to only round numbers UP. Is there any way to
do this without using the ROUNDDOWN formula? I know I can use the
ROUNDDOWN formula, but that only works if he formula is in a different
cell from the data. Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Rounding down numbers in cell

Formatting won't actually round values up or down, unless you have the
Tools/Options/Calculation/Precision as displayed checkbox checked.

To actually round values down as you type, you'd need an event macro.
You could put something like this in your worksheet code module
(right-click the worksheet tab and choose View Code):

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Const csINPUTRNG As String = "A1:A100, C1:C100"
Const cnDECPLACES = 2
Dim dScale As Double

With Target
If Not Intersect(Range(csINPUTRNG), Target) Is Nothing Then
dScale = 10 ^ -cnDECPLACES
On Error Resume Next
Application.EnableEvents = False
.Value = Int(.Value / dScale) * dScale
Application.EnableEvents = True
End If
End With
End Sub


In article . com,
wrote:

I'm trying to format a cell to round numbers DOWN as I type them.
Right now, Excel seems to only round numbers UP. Is there any way to
do this without using the ROUNDDOWN formula? I know I can use the
ROUNDDOWN formula, but that only works if he formula is in a different
cell from the data. 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
Rounding numbers nicojr Excel Discussion (Misc queries) 4 June 26th 06 07:15 PM
Rounding numbers up or down Jaco Jacobs Excel Discussion (Misc queries) 1 May 2nd 06 01:16 AM
Rounding numbers Phil Excel Discussion (Misc queries) 3 March 8th 06 09:35 PM
Rounding up numbers up or down. Eric Foucrier Excel Worksheet Functions 2 March 5th 06 01:43 AM
Rounding Numbers jack aubrey Excel Discussion (Misc queries) 1 April 18th 05 07:10 PM


All times are GMT +1. The time now is 05:31 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"