Split Numbers into Whole part and Decimal part without using the Round() Function
Suppose 12.34 is written in Cell A1 on Sheet1 and we want to split it into whole number and decimal number without using the round function.
We can do this using Trunc() formula.
Trunc() formula removes the decimal part and gives us only the whole part (Integer Number).
For the whole part:
Type formula in cell B1 '=Trunc(A1)' (Copy whatever is between quotes)
This will give 12
For the decimal part:
Type formula in Cell C1 '=A1-Trunc(A1)' (Copy whatever is between quotes)
This will give 0.34.
The logic behind this is: A1 has 12.34, A1-Trunc(A1) contains 12.34 - 12 which gives us 0.34 as a final result.
Comments
Post a Comment