Friday, July 6, 2012

Use Excel'S Trunc Function

Excel's TRUNC function truncates a number to a specified number of digits and returns the resulting number. It is important to distinguish TRUNC with INT and ROUND. TRUNC will return #VALUE! if test_number is not a number. The following steps will show use Excel's TRUNC function.


Instructions


1. Learn the syntax for TRUNC. It is TRUNC(test_number, number_of_digits) where test_number is the number to be truncated and number_of_digits specifies the precision of the truncation. The default for number_of_digits is zero.


2. Remove the fractional part of a number to make it an integer by specifying 0 for number_of_digits or omitting number_of_digits entirely.


3. Compare this use of TRUNC with INT. They are similar in that they both return integers but INT rounds a number down to the nearest integer. This only makes a difference when the number is negative. For example, TRUNC(-5.45) returns -5 but INT returns -6 because -6 is the lower number.


4. Differentiate between TRUNC and ROUND. TRUNC(7.45,1) = 7.4 and ROUND(7.45,1) = 7.5.


5. Look at some examples of how TRUNC works without a specified number_of_digits:








TRUNC(7.821) = 7. The test_number of 7.821 is truncated to 7.


TRUNC(-9.21) = -9. The test_number of -9 is truncated to -9.


6. Examine some examples of how TRUNC works using a specified number_of_digits:


TRUNC(7.821,2) = 7.82. The test_number of 7.821 is truncated to 7.82.


TRUNC(-9.21,1) = -9.2. The test_number of -9.21 is truncated to -9.2.


TRUNC(7.29,1) = 7.2. Note how 7.29 is truncated to 7.2 and not rounded to 7.3.

Tags: TRUNC test_number, test_number truncated, TRUNC test_number truncated, test_number truncated TRUNC, truncated TRUNC, examples TRUNC, examples TRUNC works