How to use the TRUNC function in Excel?
There are various ways in Excel to remove decimal and shorten numeric values. In this article, TipsMake.com will explain how to use the TRUNC function and show what makes it different from other techniques.
How to use the TRUNC function?
See examples of the TRUNC function with some sample data. The following example uses the following TRUNC function.
=TRUNC(A2)
If you do not specify how many digits are to be truncated, all decimal places will be removed.
You can see with the value in cell A2 that the TRUNC function does not apply any rounding. It simply cuts to 411.
Let us see another example. This time the example will reduce the values to two decimal places.
=TRUNC(A2,2)
The TRUNC function will not display more decimal numbers if you request it to display more numbers than you have.
Take the following example and cut it down to 2 decimal places.
=TRUNC(A2,2)
The value in cell A4 is reduced to 2 decimal places, but the values in A2 and A3 remain the same because they have fewer than two decimal places.
If you want to display two decimal numbers, the cells will need to be formatted to force them to be displayed.
Clear part of the day and time stamp
A useful example of TRUNC is to remove the time part from the date and the timestamp in Excel.
Imagine you have the following dates and timestamps, but you just want to have the date part in the column for analysis.
The following formula will remove the time portion.
=TRUNC(A2)
Although the time section has been removed, the resulting cells will still need to be formatted as dates.
Use TRUNC to shorten numbers
This is a rare technique. When you use negative numbers, the function cuts the numbers to the left of the decimal point. However, it does not change the number of digits, but replaces them with zeroes.
Take a look at the following example.
=TRUNC(A2,-1)
You can see in each example that the number 0 is used to replace the number removed to the left of the decimal point.
There are many ways in Excel to delete decimal places, however, most of them will round numbers. The strength of the TRUNC function is that it does not round values and simply shortens them to the specified number of decimal places.
You should read it
- Get started with Excel for beginners
- Tips for adding in Excel you need to know
- How to fix the SUM function doesn't add up in Excel
- Guidance on how to align Excel correctly
- How to keep Excel and Excel columns fixed?
- What is ### error in Excel? how to fix ### error in Excel
- How to display 0 in front of a number in Excel
- Instructions for searching and replacing in Excel tables
- MS Excel 2007 - Lesson 2: Customizing in Excel
- 3 ways down the line in Excel, line break, down row in 1 Excel cell
- Shortcut guide, abbreviated in Excel
- Microsoft Excel test P5