The TRUNC function
Cuts off the decimals of a number without rounding. TRUNC(8.9) is 8, and TRUNC(-8.9) is -8.
Syntax
TRUNC(number, [num_digits])- number
- The number to cut.
- num_digits (optional)
- How many decimals to keep. Left out, 0, so only the whole number is left.
Examples
D1=TRUNC(B1/60)
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Minutes worked | 135 | 2 |
B1
=TRUNC(13.14159,22)| A | B | |
|---|---|---|
| 1 | 3.14 |
In plain words: Cut 13.14159 off after 22 decimal places, without rounding.
B1=TRUNC(-8.9)
| A | B | |
|---|---|---|
| 1 | -8 |
Questions
What is the difference between TRUNC and INT?
For positive numbers they give the same result. For negative numbers INT rounds down, so INT(-8.9) is -9, while TRUNC just cuts the decimals off and gives -8.
Is TRUNC the same as ROUNDDOWN?
They give the same results. ROUNDDOWN needs the number of digits, while TRUNC uses 0 when you leave it out.