Excel TRUNC function
The TRUNC function in Excel helps to get a truncated number based on a specific number of digits, it is used to reduce or eliminate the decimal portion of a number instead of rounding the number.
- Example 1: Trunc function to remove specific number of decimal digits from numbers
- Example 2: Trunc function to remove time from list of datetime cells
Syntax:
The syntax for the TRUNC function in Excel is:
Arguments:
- number: Required. The number you want to truncate.
- num_digits: Optional. The number of decimal places to be kept. If this argument is omitted, it recognized as 0 by default.
- If num_digits is positive value, it will return the number of digits to the right of decimal point;
- If num_digits is 0 or omitted, it will truncated to the integer part;
- If num_digits is negative value, it will get the number of digits to the left of the decimal point.
Return:
Return a truncated number based on a given precision.
Examples:
Example 1: Trunc function to remove specific number of decimal digits from numbers
Supposing, you want to truncate the numbers based on a specific number of decimal digits, please apply the below formula:
And then, drag the fill handle down to the cells you want to apply this formula, you will get the result as following screenshot shown:
Example 2: Trunc function to remove time from list of datetime cells
This TRUNC function also can help to remove time from date time format, please use this formula:
And then, drag the fill handle down to the cells to apply this formula, see screenshot:
At last, you should format the calculated cells as Date format as below screenshot shown:
More articles with TRUNC function:
- Remove Digits After Decimal In Excel
- Sometimes you need to remove all digits after decimal to make numbers to whole numbers. You may think the Decrease Decimal feature can deal with it. Actually, the Decrease Decimal feature just changes a number’s display value, for example, show 2.5 as 3, but the actual value still is 2.5 showing in the formula bar. Therefore, how to remove digits after decimal in Excel?
- Extract Decimal Value From String In Excel
- This tutorial will tell you how to extract decimal value only from a string in Excel.
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...
Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)
- One second to switch between dozens of open documents!
- Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
- Increases your productivity by 50% when viewing and editing multiple documents.
- Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.