To delve into the specifics of Excel's TRUNC function and its application methods, readers can refer to the following discourse provided by Mytour.
Understanding and applying Excel's TRUNC function
1. Understanding TRUNC function
The TRUNC function in Excel serves to eliminate decimal digits. What sets it apart from other Excel functions is its lack of rounding capabilities. For instance, consider a value like 4.68. Using the TRUNC function removes the decimal digits, resulting in 4.
The structure of the TRUNC function is: =TRUNC(number, [digits])
Where:
- Parameter: number is the value from which you want to remove decimal digits.
- Parameter: digits are the decimal digits you wish to truncate. This parameter is optional; if not specified, the TRUNC function will remove all decimal digits.
2. Practical Application of TRUNC Function in Excel
Using the TRUNC function to truncate decimal numbers
To illustrate how to use the TRUNC function in Excel effectively, let's explore some examples below:
Example 1:
=TRUNC(A2)
By default, if you don't specify how many decimal places to truncate, all decimal values will be removed.
In the given example, the value in cell A2 isn't rounded; since we didn't specify how many decimal places to truncate, the TRUNC function defaults to removing all decimal digits, hence resulting in 411.
Example 2:
In the example below, we'll specify the TRUNC function to truncate 2 digits in the decimal part: =TRUNC(A2,2)
The TRUNC function doesn't truncate digits in the decimal part if we specify more digits in the decimal part than the initial value.
For example: =TRUNC(A2,2)
The value in cell A4 is truncated by 2 digits in the decimal part, whereas the values in cells A2 and A3 remain unchanged as their decimal part has fewer than 2 digits.
Utilizing TRUNC function to remove time from date and time entries
Additionally, we can employ the TRUNC function to eliminate time from date and time entries in Excel.
The following example demonstrates how to use the TRUNC function to remove the time portion from a date and time column. We will use the formula:
=TRUNC(A2)
The resulting output will be as follows:
Using TRUNC function to shorten numbers
You may not be aware that the TRUNC function also accepts negative numbers for the digits parameter. If the parameter is negative, the function will truncate digits to the left of the decimal point. The truncated digits will be replaced with 0.
Refer to the example below: =TRUNC(A2,-1)
As you can observe in the example above, the digits removed to the left of the decimal point are replaced with 0.
This article by Mytour has just introduced you to the TRUNC function in Excel. Wondering what it is and how to use it? Additionally, readers can explore other articles on Mytour to further understand various calculation functions in Excel with examples.