Svetlana,
I set up a custom function in an Excel VBA module (see
below):
Function SpecialRound(xValue As Double)
'rounds numbers to a certain number of places, based
on the number size
Dim n As Double
Dim size As Integer
n = xValue
size = Len(Str(n)) - 1
Select Case size
Case Is = 3
SpecialRound = Int((n / 10) + 0.5) * 10
Case Is = 4
SpecialRound = Int((n / 100) + 0.5) * 100
Case Is = 5
SpecialRound = Int((n / 100) + 0.5) * 100
Case Is = 6
SpecialRound = Int((n / 100) + 0.5) * 100
Case Is = 7
SpecialRound = Int((n / 1000) + 0.5) * 1000
Case Is = 8
SpecialRound = Int((n / 100) + 0.5) * 100
End Select
End Function
This function gets a number passed to it from a cell of
the worksheet. In the cell, enter the
function "=SpecialRound(cell)", where "cell" is the cell
of the number you wish to display (i.e. A3, B17). It's
not clear just how you want to format your values (i.e.
show only numbers to the nearest 100 dollars, to the
nearest 1,000 dollars, etc.). If you change the "100"
values in each of "SpecialRound = Int(n / 100) * 100"
formulas, you can change the number of places the
original value will be rounded off to (i.e. 100 will
round to hundreds, 1000 will round to thousands, etc.).
The "+ .5" causes the numbers to be rounded up if they
are above 50, and to be rounded down if they are below 50.
Andrew Lenczycki