Truncating in calculation


Posted by Jim on October 12, 2001 10:58 AM

What is the best way to get rid of extra decimal places so just 2 decimals places are used in further calculations?

I have a macro that pulls thousands of numbers with up to 10 decimal places from other sheets using VLOOKUP and plugs them into a recap sheet. I want the macro to round the numbers to 2 decimal places, inserting, displaying and using only 2 decimal places in all further calculations.

Posted by Todd on October 12, 2001 11:13 AM

when you get the number, use the round(####,2) function where #### represents the number.



Posted by Dan on October 12, 2001 11:16 AM

I believe the ROUND function will do what you need.

=ROUND(A1+B1,2)

Rounds the sum of A1 and B1 to 2 decimals. If you apply calculations to this field it should only calculate on the two decimals.

HTH