Syntax. TRUNC(number,num_digits)
Definition. This function truncates the decimal places of a number and returns an integer.
Arguments
number (required) The number you want to truncate.
num_digits (optional) A number indicating the precision of the truncation. The default value for num_digits is 0. You can specify positive and negative values for the num_digits argument.
Background. The TRUNC() function removes the fractional part of a number up to the decimal places specified in num_digits. If num_digits is omitted, the number is truncated to the integer.
The TRUNC() and ROUND() functions return the same result. The difference between both functions is that specifying the number of digits to truncate is optional for TRUNC(), but for ROUND() it is required.
Example. A practical use for this function is the truncation of money amounts, for example, to two decimal places or to even amounts. Here are some more examples:
=TRUNC(234.4692354,2) returns 234.46.
=TRUNC(234.4692354,2)
234.46
=TRUNC(234.4692354,-1) returns 230.
=TRUNC(234.4692354,-1)
230
=TRUNC(9.3) returns 9.
=TRUNC(9.3)
9
=TRUNC(-9.3) returns -9.
=TRUNC(-9.3)
-9
=TRUNC(18.628,2) returns 18.62.
=TRUNC(18.628,2)
18.62
CEILING(), CEILING.PRECISE(), FLOOR(), FLOOR.PRECISE(), INT(), MOD(), ROUND()
Sample Files
Use the ROUND worksheet in the Chapter16.xls or Chapter16.xlsx sample file. The sample files are found in the Chapter16 folder. For more information about the sample files, see the section titled Using the Sample Files.