Truncate Decimals with Trunc Function
TRUNC Function can be helpful to remove fractional part of a number.
In simple words, it will remove decimals from a number to a specific precision and then return integer part in the result.
In below example, I have used this excel function to truncate decimals and it has returned the integer part of the number without decimals as I have specified precision to zero.
number Number you want to truncate
[num_digits] A number to specify precision to truncate a number.
More Information for Excel TRUNC Function
- TRUNC is similar to INT in work.
- The difference is that trunc only remove decimals from a number where INT remove decimals by rounding down the number to the nearest integer.
In below example, I have used this function to truncate data for removing time from the dates.
As you know, excel dates are numbers in actual and time is in decimals. To convert above data into dates I have used trunc formula.
To learn more about Excel TRUNC Function you can check Microsoft’s Help Section. And, if you have a unique idea to use the trunc function, I would love to hear from you.