TRUNC ()
This function removes the decimal part of a number. And it is
also used to remove time from date-time stamp.
Best view in desktop mode.
A
|
B
|
C
|
|
1
|
Remove digits after decimal
|
||
2
|
Number
|
Result
|
|
3
|
6.2315
|
6
|
=TRUNC(A3)
|
4
|
58.521
|
58
|
=TRUNC(A4)
|
5
|
420.2568
|
420
|
=TRUNC(A5)
|
6
|
|||
7
|
Remove digits after two decimal digits
|
||
8
|
Number
|
Result
|
|
9
|
6.2315
|
6.23
|
=TRUNC(A9,2)
|
10
|
58.521
|
58.52
|
=TRUNC(A10,2)
|
11
|
420.2568
|
420.256
|
=TRUNC(A11,3)
|
12
|
|||
13
|
Trunc will not display more than you have
|
||
14
|
Number
|
Result
|
|
15
|
96
|
96
|
=TRUNC(A15,2)
|
16
|
58.5
|
58.5
|
=TRUNC(A16,2)
|
17
|
420.256
|
420.25
|
=TRUNC(A17,2)
|
18
|
|||
19
|
Shorten the value & remove decimal value
|
||
20
|
Number
|
Result
|
|
21
|
96
|
90
|
=TRUNC(A21,-1)
|
22
|
58.5
|
50
|
=TRUNC(A22,-1)
|
23
|
420.256
|
400
|
=TRUNC(A23,-2)
|
24
|
|||
25
|
Remove time from Date-Time Stamp
|
||
26
|
Date & Time
|
Date Only
|
|
27
|
10/03/2020 11:45
|
10/03/2020
|
=TRUNC(A27)
|
28
|
11/03/2020 0:00
|
11/03/2020
|
=TRUNC(A28)
|
29
|
15/08/2019 20:45
|
15/08/2019
|
=TRUNC(A29)
|
30
|
Syntax
=TRUNC(NumberToTuncate,Precision)
Where Precision
is optional
Formatting
No special
formatting is needed.
Functions for Rounding in Excel
To round
normally, use ROUND()
To round to the
nearest multiple, use MROUND()
To round up to
the nearest specified place, use ROUNDUP()
To round down to
the nearest specified place, use ROUNDDOWN()
To round up to
the nearest specified multiple, use CEILING()
To round down to
the nearest specified multiple, use FLOOR()
To round down and
return an integer only, use INT()
To truncate
decimal places, use TRUNC()
No comments:
Post a Comment