Archive of Mr Excel Message Board

Back to Forms in Excel VBA archive index
Back to archive home

=ROUND or =TRUNC ?
Posted by Chris D on January 24, 2002 12:43 PM
Hi all,
If A1 contains 100.25
What's the difference between =round(A1,2) and =trunc(A1,0) ?
many thanks
Chris

| Check out our Excel Resources
|
 |
 |
Re: =ROUND or =TRUNC ?
Posted by Juan Pablo G. on January 24, 2002 12:45 PM
I'm assuming you meant ROUND(A1,0). And in your case, nothing but if you have 100.75, Round will return 101, and Trunc will return 100.
Juan Pablo G.

Re: =ROUND or =TRUNC ?
Posted by Chris D on January 24, 2002 12:56 PM
Yep, typo, I meant =ROUND(A1,0).
No difference then ? just a different approach ?
thanks
Chris

Re: =ROUND or =TRUNC ?
Posted by Juan Pablo G. on January 24, 2002 12:57 PM
Depends, again, on your numbers. TRUNC will eliminate all decimals without even looking at them. So, 100.2 and 100.7 will be 100.
ROUND, however, will "see" the decimals. So, 100.2 will be 100 BUT 100.7 will be 101.
Juan Pablo G.

Re: =ROUND or =TRUNC ?
Posted by Chris D on January 24, 2002 1:03 PM
Ahh, thanks, yes I see....
100.99 with round is 101
100.99 with trunc is still 100
thanks
:-)

This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our
online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.