Excel TRUNC function truncates a number by removing the fractional part of the number based on a number_digits argument.
TRUNC(number, [num_digits])
number, required, the number to be truncated.
num_digits, optional, a number specifying the precision of the truncation. The default value is 0 (zero).
Usage notes:
Next is the TRUNC function which is used to cut the number 123.456 with positive or negative signs. What are the results when using different num_digits arguments?
=TRUNC(123.456)
The TRUNC function without the num_digits argument, by default Excel uses the number 0. As a result, Excel cuts all the numbers behind the decimal separator, leaving only the integer numbers.
The result is 123.
=TRUNC(123.456,2)
TRUNC function with num_digits argument 2. Excel cuts numbers behind the decimal separator and leaves two-digit numbers.
The result is 123.45
=TRUNC(123.456,4)
If the number of digits behind the decimal separator is smaller than the num_digits argument, Excel does not cut any numbers.
The result is the same as the original number 123.456.
=TRUNC(123.456,-2)
If the argument num_digits is negative, excel cuts all the numbers behind the decimal separator and changes the number in front of the decimal separator to 0. The number of numbers changed depends on the num_digits argument.
The result is 100.
=TRUNC(-123.456)
The TRUNC function with the negative number argument and without the num_digits argument. The result remains the same negative number without numbers behind the decimal separator.
The result is -123.
=TRUNC(-123.456,2)
The TRUNC function with a negative number argument and positive num_digit argument. The result is -123.45
=TRUNC(-123.456,-2)
The TRUNC function with a negative number argument and num_digit argument.
The result is a negative integer number with two-digit numbers in front of the decimal separator changing to zero. The result is -100.
Please see the results of all the excel TRUNC functions above in the picture below.
Calculate Number of Days Between Two Dates Excel has a function that calculates the number of days between two dates,…
What is Flash Fill Excel Flash Fill automatically fills your data when Excel detects a pattern in your initial data…
What is Paste Special Paste special is a paste but you can choose the result type. As we all know,…
What is the Excel TEXTJOIN Function? The excel TEXTJOIN function is the best function to concatenate strings in Excel, has…
What is the Excel CONCAT Function? The excel CONCAT function combines all data; it could be a text, a number…
What is the Excel CONCATENATE Function? The excel CONCATENATE function combines text or numbers into a text. CONCATENATE Syntax CONCATENATE(text1,…