Exceljet

Quick, clean, and to the point

Excel TRUNC Function

Excel TRUNC function
Summary 

The Excel TRUNC function returns a truncated number based on an (optional) number of digits. For example, TRUNC(4.9) will return 4, and TRUNC(-3.5) will return -3. The TRUNC function does no rounding, it simply truncates as specified.

Purpose 
Truncate a number to a given precision
Return value 
A truncated number
Syntax 
=TRUNC (number, [num_digits])
Arguments 
  • number - The number to truncate.
  • num_digits - [optional] The precision of the truncation (default is 0).
Usage notes 

Use the TRUNC function to remove the fractional part of a number and return just the integer. For example, TRUNC(4.9) will return 4, and TRUNC(-3.5) will return -3. TRUNC does not do any rounding, it simply returns the integer part of the number.

Example #1 - basic usage

=TRUNC(4.9) // returns 4
=TRUNC(-3.5) // returns -3

Example #2 - set number of decimal places

TRUNC can also be used to return a set number of decimal places without rounding, using the num_digits argument. For example, TRUNC (PI(), 2) will return 3.14 and TRUNC (PI(), 3) will return 3.141.

TRUNC (PI(), 2) // returns 3.14
TRUNC (PI(), 3) // returns 3.141

TRUNC vs INT

TRUNC is similar to the INT function because they both can return the integer part of a number. However, TRUNC simply truncates a number, while INT actually rounds a number down to an integer. With positive numbers, and when TRUNC is using the default of 0 for num_digits,  both functions return the same results. With negative numbers, the results can be different. INT(-3.1) returns -4, because INT rounds down to the lower integer. TRUNC(-3.1) returns -3. If you simply want the integer part of a number, you should use TRUNC.

Rounding functions in Excel

Excel provides a number of functions for rounding: