Personale Number Rounding!!!!!

  • Thread starter Thread starter giax79
  • Start date Start date
G

giax79

Hello!!
I have to make rounding on some numbers but the rule of my roundin
would be these:

1)if the number has the value "4" in the 3rd decimal position leave th
number rounded on second decimal. Example
if number is 8932,2341 the rounded number would be 8932,23.

2)if the number has the 3rd decimal position greater than "4", roun
off for excess. Example if number is 62725,1591 the rounded numbe
would be 62725,16.

I don't know how make this in excel because the default roundin
doesn't work with specifical number on a specifical decimal position
Someone can tell me how solve this problem???!?!
 
Use the ROUND function in which you specify the number of
decimal places you want, e.g
=ROUND(123.4446, 2) = 123.44

Kevin Beckham
 
You would need to create your own rounding function.

The function would convert the number to a string representation, then it
would determine how to round, and round as needed.
 
And how can I convert number in string, than check the 3rd decimal
position, make a condition and return the right value??!
 
Use, say, CStr function to convert to string.
The use VBA built-in string functions to parse the string.
 
Hello!!
I have to make rounding on some numbers but the rule of my rounding
would be these:

1)if the number has the value "4" in the 3rd decimal position leave the
number rounded on second decimal. Example
if number is 8932,2341 the rounded number would be 8932,23.

2)if the number has the 3rd decimal position greater than "4", round
off for excess. Example if number is 62725,1591 the rounded number
would be 62725,16.

I don't know how make this in excel because the default rounding
doesn't work with specifical number on a specifical decimal position.
Someone can tell me how solve this problem???!?!?

Yes, but the default worksheet rounding does work they way you specify!

=ROUND(8932.2349,2) --> 8932.23
=ROUND(67275.1591,2) --> 67275.16

If you are using VBA, be sure you use Application.WorksheetFunction.Round as
later versions of VBA round differently.




--ron
 
Back
Top